The unregister()
method of the RegisteredUserScript
object unregisters the user scripts represented by the object, user scripts that were registered using userScripts.register()
.
Note: User Scripts are automatically unregistered when the related extension page (from which the user scripts were registered) is unloaded, so you should register a user script from an extension page that persists at least as long as you want the user scripts to stay registered.
const registeredUserScript = await browser.userScripts.register( userScriptOptions // object ); … await registeredUserScript.unregister()
None.
A Promise
that is resolved once the user scripts are unregistered. The promise does not return a value.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
unregister |
No |
No |
68
66
|
? |
No |
No |
? |
? |
68 |
? |
? |
? |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/userScripts/RegisteredUserScript/unregister