I need to update something on the tabs, for example, check that the page loads correctly and replace something inside the page. here is my code
// background.js chrome.tabs.onUpdate.addListener(function(tabId, changeInfo, tab){ try{ chrome.tabs.executeScript(tabId, filename); } catch(e) { // 1. when I open a new tab // 1. Error during tabs.executeScript: Unknown error. // 2. when I request a url not arrive-able. // 2. Error during tabs.executeScript: Cannot access contents of url // "data:text/html,chromewebdata". Extension manifest must request // permission to access this host. // but I can't catch these errors, they just appers in background console. } });
I am trying to execute a script while loading it, but if the current tab is chrome: // newtab or a page with a chrome error, I cannot do this, but I cannot catch the error.
source share