In Chrome it is possible to run content scripts after an extension is installed, that is, the code below works and the words 'content script' are shown in the console log of all open tabs after the installation.
In Edge, however, this does not work. It seems to be a bug in Edge. Any ideas how to work around so that content-script.js is executed after extension installation in all tabs?
background.js
browser.runtime.onInstalled.addListener(function(details) {
var scripts = browser.runtime.getManifest().content_scripts[0].js;
browser.tabs.query({}, function(tabs) {
tabs.forEach(function(tab){
for(var k=0; k<scripts.length; k++) {
browser.tabs.executeScript(tab.id, {
file: scripts[k]
});
}
});
});
});
content-script.js
console.log("content script");