Skip to content

fix!: Update content and unlisted script globalName default to false - #2511

Merged
aklinker1 merged 1 commit into
majorfrom
default-global-name-false
Jul 26, 2026
Merged

fix!: Update content and unlisted script globalName default to false#2511
aklinker1 merged 1 commit into
majorfrom
default-global-name-false

Conversation

@aklinker1

@aklinker1 aklinker1 commented Jul 26, 2026

Copy link
Copy Markdown
Member

Warning

BREAKING CHANGE: If your script needs to return a value, like for browser.scripting.executeScript, set globalName: true to maintain the old behavior.

Overview

Don't generate IIFE global variable for content and unlisted scripts by default. This prevents generating extra code when a return value isn't necessary.

This closes #2156

@github-actions github-actions Bot added the pkg/wxt Includes changes to the `packages/wxt` directory label Jul 26, 2026
@aklinker1 aklinker1 mentioned this pull request Jul 26, 2026
29 tasks
@aklinker1
aklinker1 marked this pull request as ready for review July 26, 2026 16:11
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.36%. Comparing base (0263c77) to head (9ab474b).

Additional details and impacted files
@@            Coverage Diff             @@
##            major    #2511      +/-   ##
==========================================
+ Coverage   79.31%   79.36%   +0.05%     
==========================================
  Files         131      131              
  Lines        3969     3969              
  Branches      905      905              
==========================================
+ Hits         3148     3150       +2     
+ Misses        730      728       -2     
  Partials       91       91              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1
aklinker1 merged commit 0c107f3 into major Jul 26, 2026
15 checks passed
@aklinker1
aklinker1 deleted the default-global-name-false branch July 26, 2026 16:14
aklinker1 added a commit that referenced this pull request Jul 26, 2026
…se` (#2511)

BREAKING CHANGE: If your script needs to return a value, like for `browser.scripting.executeScript`, set `globalName: true` to maintain the old behavior.
aklinker1 added a commit that referenced this pull request Jul 26, 2026
…se` (#2511)

BREAKING CHANGE: If your script needs to return a value, like for `browser.scripting.executeScript`, set `globalName: true` to maintain the old behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant