Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
4 results across 6 corpora for userScripts.onBeforeScript (Legacy).
Developer library 4
user_scripts
ore the user script sandbox object is created and the custom API methods can be exported. To export the custom API methods, the script listens for userScripts.onBeforeScript and then export the custom API methods. Not every user script may need to consume all of the custom API methods. You can, therefore, include details of the APIs needed in `scriptMetadata` when running userScripts.register(). The API script then
userScripts (Legacy)
register() method. It represents the content scripts to register. ## Methods - userScripts.register() - : Registers user scripts. ## Events - userScripts.onBeforeScript - : An event available to the API script, registered in [`"user_scripts"`](/docs/Mozilla/Add-ons/WebExtensions/manifest.json/user_scripts), that execute before a user script executes. Use it to trigger the export of the additional APIs provide
Working with userScripts
Value:" "website address", "NewStoredValue:" "website address"}"](user_script_in_action.png) ## See also - userScripts - userScripts.register() - userScripts.onBeforeScript
userScripts.onBeforeScript (Legacy)
acy `userScripts` API. It's available in Firefox for Manifest V2. For functionality to work with user scripts in Manifest V3 see the new userScripts API. The `onBeforeScript` event of the browser.userScripts is fired before a user script is executed. It can only be included in the API script, the script registered in [`"user_scripts"`](/docs/Mozilla/Add-ons/WebExtensions/manifest.json/user_scripts), where it is used