I've read the documentation and understand that this is to be expected:
Scripts are injected into the top-level page and any children with HTML sources, such as iframes. Do not assume that there is only one instance of your script per browser tab.
I'm wondering, though:
- Other than iframes, what other elements have "HTML sources" (images? objects?)? The term "HTML sources" is uncomfortably vague to my ears.
- Is there any way to detect which element is executing the script?
I've filtered out iframes by determining that window === window.top
, as recommended, but other elements are still executing the script and it's executing a lot more than I'd like.
Thanks.