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])) { const gldata = await parsetab(details.tabId); if (gldata.repo) { browser.pageAction.show(details.tabId); } return; } } });