RegisteredUserScript.unregister() (Legacy)

Warning: This is documentation for the legacy 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 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.

Syntax

js
const registeredUserScript = await browser.userScripts.register(
  userScriptOptions       // object
);
// …
await registeredUserScript.unregister()

Parameters

None.

Return value

A Promise that is resolved once the user scripts are unregistered. The promise does not return a value.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
unregister (Legacy)
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 68 (Release date: 2019-07-09)
footnote
footnote Only available for use in extensions using Manifest V2. For extension using Manifest V3, see userScripts.unregister.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 68 (Release date: 2019-07-09)
footnote
footnote Only available for use in extensions using Manifest V2. For extension using Manifest V3, see userScripts.unregister.
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also