Skip to content

fix: Output content scripts in ascii to avoid utf8 encoding errors#2204

Merged
aklinker1 merged 5 commits intomainfrom
charset-fix
Mar 19, 2026
Merged

fix: Output content scripts in ascii to avoid utf8 encoding errors#2204
aklinker1 merged 5 commits intomainfrom
charset-fix

Conversation

@aklinker1
Copy link
Member

@aklinker1 aklinker1 commented Mar 19, 2026

Overview

Enforces ascii character set output, required by Chrome for chrome extensions.

For example, this will change 丂 → \u4E02 in the bundled output.

  • Ensure it works
  • Only set for content scripts, only content scripts have this problem. I'm just gonna enable it for everything, hard to know if unlisted scripts that are injected would also cause this problem or not. Shouldn't cause bundle size to increase too much.

Manual Testing

N/A, see unit test changes.

Related Issue

This PR closes #353

@netlify
Copy link

netlify bot commented Mar 19, 2026

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 2a21ed6
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/69bc67e2332cfc000835fdf0
😎 Deploy Preview https://deploy-preview-2204--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the pkg/wxt Includes changes to the `packages/wxt` directory label Mar 19, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2204

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2204

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2204

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2204

@wxt-dev/is-background

npm i https://pkg.pr.new/@wxt-dev/is-background@2204

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2204

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2204

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2204

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2204

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2204

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2204

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2204

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2204

wxt

npm i https://pkg.pr.new/wxt@2204

commit: e842d70

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (5376cfd) to head (2a21ed6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2204      +/-   ##
==========================================
+ Coverage   76.22%   76.50%   +0.27%     
==========================================
  Files         115      115              
  Lines        3092     3094       +2     
  Branches      684      685       +1     
==========================================
+ Hits         2357     2367      +10     
+ Misses        652      646       -6     
+ Partials       83       81       -2     

☔ View full report in Codecov by Sentry.
📢 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 marked this pull request as ready for review March 19, 2026 16:51
Co-authored-by: Jorge Fuentes <jsfuentes@users.noreply.github.com>
@aklinker1 aklinker1 changed the title fix: Output files in ascii to avoid utf8 encoding errors fix: Output content scripts in ascii to avoid utf8 encoding errors Mar 19, 2026
@aklinker1 aklinker1 merged commit c528361 into main Mar 19, 2026
14 of 15 checks passed
@aklinker1 aklinker1 deleted the charset-fix branch March 19, 2026 21:18
@github-actions
Copy link
Contributor

Thanks for helping make WXT better!

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.

Failed to load extension: It isn't UTF-8 encoded

1 participant