Repository navigation
feat!: Add support for "main world" content scripts - #284
Merged
Merged
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
aklinker1
marked this pull request as ready for review
December 13, 2023 21:34
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
==========================================
- Coverage 70.20% 69.98% -0.23%
==========================================
Files 133 135 +2
Lines 7395 7459 +64
Branches 575 580 +5
==========================================
+ Hits 5192 5220 +28
- Misses 2153 2187 +34
- Partials 50 52 +2 ☔ View full report in Codecov by Sentry. |
Contributor
|
It seems this line might not reflect the recent breaking changes. Should it be updated to |
Member
Author
|
@mefengl good catch! I'll fix it today |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #282.
Now, when a content script is built, it will use different virtual entrypoints depending on the
worldoption. If it'sundefinedor"ISOLATED", it will continue working as-is. If it's"MAIN", then a separate entrypoint is imported that doesn't load thewebextension-polyfill, since main world content scripts run in a sandboxed environment without access to the extension APIs.BREAKING CHANGE: In order to isolate the
webextension-polyfillfrom being imported automatically fromwxt/clientwhen importingdefineContentScript,defineContentScriptanddefineBackgroundScripthave been moved fromwxt/clienttowxt/sandbox.