From fae02a6d27436a6270cb9bece69659c965e1ab39 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sat, 10 Aug 2024 18:14:29 -0400 Subject: [PATCH] Replace page action with action --- extension/chrome/manifest.json | 4 ++-- extension/src/background/index.ts | 4 +++- extension/src/background/store/apiMiddleware.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/extension/chrome/manifest.json b/extension/chrome/manifest.json index 71586604..ca2faa92 100644 --- a/extension/chrome/manifest.json +++ b/extension/chrome/manifest.json @@ -22,9 +22,9 @@ "devtools-remote": { "description": "Remote DevTools" }, - "_execute_page_action": { + "_execute_action": { "suggested_key": { - "default": "Ctrl+Shift+E" + "default": "Ctrl+Shift+F" } } }, diff --git a/extension/src/background/index.ts b/extension/src/background/index.ts index 8b81adf3..417e246a 100644 --- a/extension/src/background/index.ts +++ b/extension/src/background/index.ts @@ -12,8 +12,10 @@ chrome.commands.onCommand.addListener((shortcut) => { openDevToolsWindow(shortcut as DevToolsPosition); }); -// Create the context menu when installed +// Disable the action by default and create the context menu when installed chrome.runtime.onInstalled.addListener(() => { + chrome.action.disable(); + syncOptions().get((option) => { if (option.showContextMenus) createMenu(); }); diff --git a/extension/src/background/store/apiMiddleware.ts b/extension/src/background/store/apiMiddleware.ts index 54c52ae6..52ac84d8 100644 --- a/extension/src/background/store/apiMiddleware.ts +++ b/extension/src/background/store/apiMiddleware.ts @@ -605,8 +605,8 @@ function onConnect>(port: chrome.runtime.Port) { if (msg === 'heartbeat') return; if (msg.name === 'INIT_INSTANCE') { if (typeof id === 'number') { - chrome.pageAction.show(id); - chrome.pageAction.setIcon({ tabId: id, path: 'img/logo/38x38.png' }); + chrome.action.enable(id); + chrome.action.setIcon({ tabId: id, path: 'img/logo/38x38.png' }); } if (isMonitored) port.postMessage({ type: 'START' });