fix: don't add an empty content_scripts array for runtime-only content scripts - #2580
Merged
aklinker1 merged 1 commit intoAug 6, 2026
Merged
Conversation
…t scripts `manifestContentScripts.length >= 0` is always true, so `content_scripts` was set to `[]` in the manifest whenever every content script entrypoint used `registration: 'runtime'`. Chrome and Firefox silently ignore the empty array, but Safari's web extension converter flags it as an unsupported/invalid key.
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2 tasks
aklinker1
approved these changes
Aug 6, 2026
aklinker1
enabled auto-merge (squash)
August 6, 2026 10:16
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2580 +/- ##
==========================================
- Coverage 79.34% 79.21% -0.13%
==========================================
Files 134 134
Lines 3994 3994
Branches 921 921
==========================================
- Hits 3169 3164 -5
- Misses 730 734 +4
- Partials 95 96 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Thanks for helping make WXT better! |
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.
Summary
manifestContentScripts.length >= 0is a tautology (array length is never negative), somanifest.content_scriptswas set to[]whenever a project had at least one content script entrypoint but every one of them usedregistration: 'runtime'.Chrome and Firefox silently ignore the empty array, but Safari treats it as invalid. The build/convert step itself doesn't complain, but once the converted extension is run and inspected in Safari, its Extensions settings show:
(Reproduced by building a project whose only content script uses
registration: 'runtime', converting it withwxt zip -b safari, then opening the extension in Safari.)Changes
manifestContentScripts.length >= 0→> 0, socontent_scriptsis only added to the manifest when there's actually something to declare.content_scriptsequals[]for a runtime-only project — it now assertsundefined, matching the convention used elsewhere in the same file (e.g. the "skipped entrypoints" test).Test plan
vitest run src/core/utils/__tests__/manifest.test.ts— 92 tests passing, run repeatedly across several randomfakerseedstsc --noEmit— no new errors