userScripts.resetWorldConfiguration()

Resets the configuration of a USER_SCRIPT world set by userScripts.configureWorld to the defaults specified in userScripts.WorldProperties. When the default world is reset, all worlds without an explicit configuration are also reset.

Changes to world configurations only apply to new instances of the world: A configuration won't apply to a world initialized by the execution of a user script in a document until the document is reloaded. However, the browser may revoke certain privileges when a configuration is updated. For example, message calls from a USER_SCRIPT world may fail when messaging is reset to false.

Syntax

js
let resettingWorldConfiguration = browser.userScripts.resetWorldConfiguration(
  worldId       // optional string
);

Parameters

worldId Optional

string The ID of the USER_SCRIPT world to reset. If omitted or empty, resets the configuration of the default world and all worlds without a configuration set by userScripts.configureWorld.

Return value

A Promise fulfilled with no arguments if the world configuration is reset. If the request fails, the promise is rejected with an error message.

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
resetWorldConfiguration
Chrome – Full support
Chrome 133 (Release date: 2025-02-04)
footnote Full support
Edge – Full support
Edge 133 (Release date: 2025-02-06)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 118 (Release date: 2025-04-15)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 138 (Release date: 2025-04-29)
footnote Full support
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