how can i fire code in a content-script, after the js-code of the actual website has finished?
In Chrome it works fine with window.onload = function(){…}.
If the page has already a onload event, the onload event in the contentscript fire at last.
But in Firefox, the event will be overwriten. Only my own code will be executed.
This only seems to work on pages that load external scripts, like https://www.google.com/. And only if you update the page manually.
With simple HTML pages the function does not fire.
Possibly by the time the content script adds the event listener, the load event already fired? Perhaps check the readyState and if it is complete just run your function immediately rather than scheduling it to run on load.