Event handlers not fired

I suspect this is not exactly add-on-specific, but I find that the event handlers registered from my content script aren’t getting invoked on this page: https://tek.brick.do/c324939a-8ca2-4156-8e93-96e4a2c6b05a. I had both key and mouse handlers registerd, and neither are invoked when they’re expected.

That said, I did this from a development tool console:

document.addEventListener("click", () => console.log("clicked"));

If I do this on other pages, I get the log printed on the console, but nothing on this particular page. I’m wondering what’s going on. Can someone chip in?


Maybe it is because the content is in an <iframe>?

If it’s not due to the iframing, it could also be that they cancel the click event, so it doesn’t bubble up to document. If so, making the listener capturing may solve it.

I was under the impression that extension event handling is independent of that in the page. I.e., they don’t/can’t interact?

The content script gets clean references to the DOM API bindings of the page, however all the DOM constructs (tree, events etc.) are the same for both sides. You just don’t see modifications to the API objects.