diff --git a/sitecompanion/content.js b/sitecompanion/content.js index 4fdd162..9ab02ef 100644 --- a/sitecompanion/content.js +++ b/sitecompanion/content.js @@ -459,7 +459,12 @@ function createToolbar(shortcuts, position = "bottom-right", themeMode = "light" box-shadow: 0 8px 20px ${tokens.glow}; `; btn.addEventListener("click", () => { - chrome.runtime.sendMessage({ type: "RUN_SHORTCUT", shortcutId: shortcut.id }); + chrome.runtime.sendMessage( + { type: "RUN_SHORTCUT", shortcutId: shortcut.id }, + () => { + void chrome.runtime.lastError; + } + ); }); toolbar.appendChild(btn); } @@ -571,6 +576,11 @@ const observer = new MutationObserver(() => { observer.observe(document.documentElement, { childList: true, subtree: true }); +chrome.storage.onChanged.addListener(() => { + if (suppressObserver) return; + scheduleToolbarRefresh(); +}); + chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => { if (!message || typeof message !== "object") return; if (message.type === "FIND_SCOPE") { diff --git a/sitecompanion/manifest.json b/sitecompanion/manifest.json index c7f27e9..e39b611 100644 --- a/sitecompanion/manifest.json +++ b/sitecompanion/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "SiteCompanion", - "version": "0.4.2", + "version": "0.4.3", "description": "AI companion for site-bound text extraction and tasks.", "permissions": ["storage", "activeTab"], "host_permissions": [""],