From c6845a798c99e96aa0e2f6daece0684a8ac50681 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 19 Nov 2023 16:21:29 +0100 Subject: wip --- background.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 background.js (limited to 'background.js') diff --git a/background.js b/background.js new file mode 100644 index 0000000..3035416 --- /dev/null +++ b/background.js @@ -0,0 +1,16 @@ +chrome.webNavigation.onCommitted.addListener(async details => { + // Check if the navigation is in the main frame + if (details.frameId !== 0) { + return; + } + + // If the url is in the list of domains, show the page action + const domains = await StorageGetDomains(); + for (let i = 0; i < domains.length; i++) { + if (details.url.includes(domains[i])) { + browser.pageAction.show(details.tabId); + return; + } + } +}); + -- cgit v1.2.3