Skip to content

Conversation

@ion1
Copy link

@ion1 ion1 commented Jun 19, 2025

Overview

script.innerHTML seems to act like script.text and not do anything unsafe with special characters, but it seems more appropriate to use text.

Manual Testing

Any injectScript invocation in MV2 mode will hit the code path. I have tested it in Firefox.

Related Issue

N/A

`script.innerHTML` seems to act like `text` and not do anything unsafe
with special characters, but it seems more appropriate to use `text`.
@ion1 ion1 requested review from Timeraa and aklinker1 as code owners June 19, 2025 17:19
@netlify
Copy link

netlify bot commented Jun 19, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 421cf43
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/688f759a94ac540008572a2e
😎 Deploy Preview https://deploy-preview-1764--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.

@aklinker1
Copy link
Member

Hey, thanks for your PRs! I'm back from a break and I am going through all the PRs oldest to newest, prioritizing bugs. So it might be a few weeks before I get to these 🙏

@aklinker1 aklinker1 changed the title refactor: Use script.text instead of innerHTML in injectScript refactor: Use script.text instead of innerHTML in injectScript Aug 3, 2025
@aklinker1 aklinker1 changed the title refactor: Use script.text instead of innerHTML in injectScript refactor: Use script.text instead of innerHTML in injectScript Aug 3, 2025
Copy link
Member

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, tested and this seems to work. Probably safer than innerHTML.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 3, 2025

Open in StackBlitz

@wxt-dev/analytics

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

@wxt-dev/auto-icons

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

@wxt-dev/browser

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

@wxt-dev/i18n

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

@wxt-dev/module-react

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

@wxt-dev/module-solid

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

@wxt-dev/module-svelte

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

@wxt-dev/module-vue

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

@wxt-dev/runner

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

@wxt-dev/storage

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

@wxt-dev/unocss

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

@wxt-dev/webextension-polyfill

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

wxt

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

commit: 421cf43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants