How do inject a script into a website *before* the first script on this website is able to run?
The 8472
8472-mozaddons at infinite-source.de
Tue Aug 15 16:07:31 UTC 2017
On 15.08.2017 18:00, Manuel Reimer wrote:
> It actually works if I place my whole code directly inside my content-script.
You really should not load things via a <script> tag when you actually want to run it as content-script. Those are separate security scopes.[0]
If you just want to load some library into the content script context before your page script loads specify both in the manifest, it takes an array[1]
[0] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Content_script_environment
[1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_scripts#js
More information about the Dev-addons
mailing list