userScripts.ExecutionWorld

The execution environment for a script injected with userScripts.register() or userScripts.update().

Type

Values of this type are a string. Possible values are:

  • MAIN

    The web page execution environment. This environment is shared with the web page without isolation. Scripts in this environment don't have access to the APIs that are only available to content scripts.

    Warning: Web pages can detect and interfere with the executed code due to the lack of isolation. Therefore, don't use the MAIN world unless it's acceptable for web pages to read, access, or modify the logic or data that flows through the executed code.

  • USER_SCRIPT

    The default execution environment for user scripts. This environment is isolated from the page's context and other USER_SCRIPT worlds. Extension APIs are unavailable, unlike ISOLATED worlds of content scripts. Several USER_SCRIPT worlds can exist when scripts are registered with worldId. userScripts.configureWorld() is used to change the configuration of a USER_SCRIPT world.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
ExecutionWorld
Chrome – Full support
Chrome 120 (Release date: 2023-12-05)
footnote Full support
Edge – Full support
Edge 120 (Release date: 2023-12-07)
footnote Full support
Firefox – Full support
Firefox 136 (Release date: 2025-03-04)
footnote Full support
Opera – Full support
Opera 106 (Release date: 2023-12-19)
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