Closed Bug 1911835 Opened 1 year ago Closed 1 year ago

Implement USER_SCRIPT world

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(4 files)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1875475#c3 for details.

User scripts should be able to execute in its own world. There is a default USER_SCRIPT world, but an extension can also specify a different world by worldId (https://github.com/w3c/webextensions/blob/main/proposals/multiple_user_script_worlds.md).

A world that the user script executes in is essentially its own sandbox. The default CSP of that world is configurable, per worldId.

Depends on: 1930749

This patch adds the USER_SCRIPT value as a supported value in the
internal WebExtensionContentScript constructor.

This patch does not introduce a distinct USER_SCRIPT sandbox yet; that
will be done in the next patch.

Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/f6472589c502 Accept USER_SCRIPT as world value in internals r=zombie https://hg.mozilla.org/integration/autoland/rev/039a1db1d7bf Add sandbox for USER_SCRIPT world r=zombie https://hg.mozilla.org/integration/autoland/rev/be2e3819905d Add support for multiple USER_SCRIPT worlds r=zombie
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/c00c85687c71 Add methods to configure csp in USER_SCRIPT worlds r=zombie
See Also: → 1587494
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: