Content-Script not working after recent chrome update.

160 views
Skip to first unread message

Moiz Usman Butt

unread,
Nov 4, 2024, 11:26:36 AMNov 4
to Chromium Extensions
I developed an extension in react with a content script that injects into the DOM. It was functioning correctly in the previous Chrome version (129.0.6668.101). However, after updating to the latest version (130.0.6723.70), the content script has stopped working and is now throwing the following error. Could you please assist me in resolving this issue?
Refused to load the script 'chrome-extension://988e3aef-db63-41cd-9bd6-373b6be99ed0/assets/main.jsx-46268d1b.js' because it violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.



Moiz Usman Butt

unread,
Nov 4, 2024, 11:26:37 AMNov 4
to Chromium Extensions
I developed an extension with a content script that injects into the DOM. It was functioning correctly in the previous Chrome version (129.0.6668.101). However, after updating to the latest version (130.0.6723.70), the content script has stopped working and is now throwing the following error. Could you please assist me in resolving this issue?

Bala Abhinav

unread,
Nov 4, 2024, 11:29:37 AMNov 4
to Moiz Usman Butt, Chromium Extensions
Hey Moiz,

Are you using crxjs in your dev setup? If so, try updating to the latest version of crxjs. I faced the same issue few days back.

Best,
Bala

On Mon, Nov 4, 2024 at 9:56 PM 'Moiz Usman Butt' via Chromium Extensions <chromium-...@chromium.org> wrote:
I developed an extension in react with a content script that injects into the DOM. It was functioning correctly in the previous Chrome version (129.0.6668.101). However, after updating to the latest version (130.0.6723.70), the content script has stopped working and is now throwing the following error. Could you please assist me in resolving this issue?
Refused to load the script 'chrome-extension://988e3aef-db63-41cd-9bd6-373b6be99ed0/assets/main.jsx-46268d1b.js' because it violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.



--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6e128d34-0a53-4213-90ed-5431b992a48bn%40chromium.org.

Oliver Dunk

unread,
Nov 4, 2024, 11:31:15 AMNov 4
to Bala Abhinav, Moiz Usman Butt, Chromium Extensions
Hi Moiz,

Are you using CRX.JS as Bala mentioned, or have you perhaps manually listed this file under `web_accessible_resources` in the manifest with the `use_dynamic_url` key?

In Chrome 130, we launched support for `use_dynamic_url` and this caused a similar error: https://issues.chromium.org/363027634

We've now fixed that so from Chrome 132, this should no longer be an issue. In the meantime, you can set the field to false to revert to the previous behavior.
Oliver Dunk | DevRel, Chrome Extensions | https://developer.chrome.com/ | London, GB


Reply all
Reply to author
Forward
0 new messages