summaryrefslogtreecommitdiff
path: root/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'background.js')
-rw-r--r--background.js16
1 files changed, 16 insertions, 0 deletions
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;
+ }
+ }
+});
+