Running content script after page load not working

//content_script.js
(function() {
    window.addEventListener('load', function() {
       console.log('here');
    });
})();

As simple as that, I want my content script do something after the page fully loaded, but I cannot even receive a log call

I can’t answer your question.
But I have two questions of my own:

  1. Why are you using an https://en.wikipedia.org/wiki/Immediately_invoked_function_expression
  1. Why are you using window.addEventListener(‘load’, …)
    instead of https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#run_at

edit:
“run_at”: “document_idle” isn’t even necessary, because that’s the default.

why not?

Additional text to let me post my answer, sicne it has to be 20 characters.

Possibly the event already occurred at the time your content script runs. Perhaps check the following property first and only create a listener if the document is still loading:

It was just a missing semicolon ¬_¬