Skip to content

world in content_scripts declaration #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hanguokai opened this issue Nov 9, 2023 · 2 comments
Closed

world in content_scripts declaration #485

hanguokai opened this issue Nov 9, 2023 · 2 comments
Labels
implemented: chrome Implemented in Chrome implemented: firefox Implemented in Firefox implemented: safari Implemented in Safari

Comments

@hanguokai
Copy link
Member

Since Chrome 111, Chrome supports a new key world in content_scripts in manifest, which value is "ISOLATED"(default) or "MAIN". Thus developers can declare content scripts to run in the main world directly.

In the meeting Nov 9, 2023, we also discussed this issue when we were discussing #482 . At the moment, Firefox and Safari support (or will support) world in browser.scripting API, and they are supportive of the world key in manifest.

@hanguokai hanguokai added implemented: chrome Implemented in Chrome supportive: safari Supportive from Safari supportive: firefox Supportive from Firefox and removed needs-triage labels Nov 9, 2023
birtles added a commit to birchill/10ten-ja-reader that referenced this issue Jan 2, 2024
Fixes #1529.

MV3 only allows the values "self", "wasm-unsafe-eval", and
"wasm-unsafe-eval" for an extension's `script-src` CSP setting.

As a result, we can no longer use inline script to update the main world
`window` global in order to enable Google Docs' annotated canvas mode.

Instead we use the new `world: 'MAIN'` setting and in Firefox, which
doesn't yet support that setting, we use Firefox's X-ray vision object
unwrapping.

Safari doesn't support Google Docs' annotated canvas due to:

  https://bugs.webkit.org/show_bug.cgi?id=232781

However, Safari have indicated support for implementing `world: 'MAIN'`
in:

  w3c/webextensions#485
birtles added a commit to birchill/10ten-ja-reader that referenced this issue Jan 2, 2024
Fixes #1529.

MV3 only allows the values "self", "wasm-unsafe-eval", and
"wasm-unsafe-eval" for an extension's `script-src` CSP setting.

As a result, we can no longer use inline script to update the main world
`window` global in order to enable Google Docs' annotated canvas mode.

Instead we use the new `world: 'MAIN'` setting and in Firefox, which
doesn't yet support that setting, we use Firefox's X-ray vision object
unwrapping.

Safari doesn't support Google Docs' annotated canvas due to:

  https://bugs.webkit.org/show_bug.cgi?id=232781

However, Safari have indicated support for implementing `world: 'MAIN'`
in:

  w3c/webextensions#485
bkzhn pushed a commit to bkzhn/10ten-ja-reader that referenced this issue Jan 11, 2024
Fixes birchill#1529.

MV3 only allows the values "self", "wasm-unsafe-eval", and
"wasm-unsafe-eval" for an extension's `script-src` CSP setting.

As a result, we can no longer use inline script to update the main world
`window` global in order to enable Google Docs' annotated canvas mode.

Instead we use the new `world: 'MAIN'` setting and in Firefox, which
doesn't yet support that setting, we use Firefox's X-ray vision object
unwrapping.

Safari doesn't support Google Docs' annotated canvas due to:

  https://bugs.webkit.org/show_bug.cgi?id=232781

However, Safari have indicated support for implementing `world: 'MAIN'`
in:

  w3c/webextensions#485
@Rob--W Rob--W added implemented: firefox Implemented in Firefox and removed supportive: firefox Supportive from Firefox labels May 8, 2025
@Rob--W
Copy link
Member

Rob--W commented May 8, 2025

Support for world was introduced in Firefox 128 last year, https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/128#changes_for_add-on_developers

@carlosjeurissen carlosjeurissen added implemented: safari Implemented in Safari and removed supportive: safari Supportive from Safari labels May 8, 2025
@carlosjeurissen
Copy link
Contributor

Apple added support for world in the manifest in Safari 18 (Released 2024-09-16) and in scripting.RegisteredContentScript in
Safari 16.4 (Released 2023-03-27).

Considering all browsers now have implemented world, and our policy to close issues once all browsers have implemented a specific issue, closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: chrome Implemented in Chrome implemented: firefox Implemented in Firefox implemented: safari Implemented in Safari
Projects
None yet
Development

No branches or pull requests

3 participants