I see now, thanks for the tip. I’d like to be able to dynamically add/remove listeners while running, so adding the listener to the manifest is not the best option.
I did add the runAt option to the manifest. While it seems that the code executes a bit sooner, it’s still much worse (much later) than with xul addons (as it’s done here: https://github.com/oyvindio/skts).
On top of that, is there any way to make the code run on newtab page, about:* pages?