I have this piece of code in my background.js:
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.status == 'complete') {
chrome.tabs.executeScript(null, {code:"alert('Loaded');"});
}
});
This should give me an alert every time a page is loaded, but it doesn’t..
Check the
tabspermission on your manifest file. Also use the tabId onexecuteScript:If this doesn’t resolve your problem give me more details.