Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"storage",
"activeTab",
"scripting",
"notifications"
"notifications",
"identity"
],

"host_permissions": [
Expand All @@ -19,9 +20,16 @@
"https://api.openai.com/*",
"https://api.anthropic.com/*",
"https://generativelanguage.googleapis.com/*",
"https://en.wiktionary.org/*"
"https://en.wiktionary.org/*",
"https://www.googleapis.com/*",
"https://oauth2.googleapis.com/*"
],

"oauth2": {
"client_id": "PLACEHOLDER.apps.googleusercontent.com",
"scopes": ["https://www.googleapis.com/auth/drive.appdata"]
},

"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
Expand Down
2 changes: 2 additions & 0 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { saveCard } from '../storage/cardStorage.js';
import { createCard, validateLlmData } from '../shared/cardSchema.js';
import { getConfig } from '../config/configStorage.js';
import { t } from '../i18n/strings.js';
import { pushSync } from '../sync/syncManager.js';

const MENU_ID = 'ordforrad_add';

Expand Down Expand Up @@ -71,6 +72,7 @@ chrome.contextMenus.onClicked.addListener(async (info, tab) => {
const card = createCard(word, context, tab.url ?? '', data);

await saveCard(card);
pushSync().catch(err => console.warn('[Ordforråd] Sync push failed:', err));
await chrome.storage.session.remove('lastError');
chrome.action.setBadgeText({ text: '' });
chrome.runtime.sendMessage({ type: 'CARD_ADDED', card, word }).catch(() => {});
Expand Down
2 changes: 1 addition & 1 deletion src/config/configStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* and default values.
*/

const CONFIG_KEY = 'user_config';
import { CONFIG_KEY } from '../shared/storageKeys.js';

/** Maps ISO language codes to German language keys (reverse of LANG_CODE). */
const LANG_CODE_REVERSE = {
Expand Down
Loading