I’m new to this add on development and followed some tutorials by firefox.
I want to call a content script when a page DOM has loaded. This script will log the URL (as test purpose)
I have browserAction map with index.html and script.js. This script.js has the code:let executing = browser.tabs.executeScript({ file: "../content-script.js" }); executing.then(onExecuted, onError);
Where I try to call the content-script.js. The functions of onExecuted and onError will log.
Also inside the content-script I will log : browser.webNavigation.onDOMContentLoaded.addListener(logOnDOMContentLoaded, filter);
In my manifest I have set the permissions for webNavigation and tabs.
The problem is, I don’t see any log at all. So I guess the script is not even executed.
Can somebody help me with calling the content script or point towards a tutorial that works?