e01.org

userScripts.WorldProperties

The configuration of a USERSCRIPT execution environment. Used in userScripts.configureWorld and userScripts.getWorldConfigurations.

The configuration of a `USER_SCRIPT` execution environment. Used in userScripts.configureWorld and userScripts.getWorldConfigurations.

## Type

Values of this type are an object containing these properties:

- `worldId`
- : `string`. The identifier for the world. Values with leading underscores (`_`) are reserved. The maximum length is 256 characters. Defaults to the default `USER_SCRIPT` world (""). To run a user script in this world, pass this value as the `worldId` property in userScripts.RegisteredUserScript when registering or updating a user script.
- `csp`
- : `string`. The world's Content Security Policy (CSP). Defaults to the [default CSP for content scripts](/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy#csp_for_content_scripts), which prohibits dynamic code execution, such as `eval()`.
- `messaging`
- : `boolean`. Whether the runtime.sendMessage and runtime.connect methods are exposed to the user script world. Defaults to hiding these messaging APIs. The runtime.onUserScriptMessage and runtime.onUserScriptConnect event handlers are triggered when these methods are called.

h2

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"userScripts.WorldProperties". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/userScripts/WorldProperties

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·