fixed toolbar update logic
This commit is contained in:
@@ -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") {
|
||||
|
||||
@@ -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": ["<all_urls>"],
|
||||
|
||||
Reference in New Issue
Block a user