Refused to execute inline script

2,491 views
Skip to first unread message

Vanessa Dias

unread,
Aug 10, 2023, 6:51:20 AM8/10/23
to Chromium Extensions

Hello Team,

I am getting an error in console how do I fix this.

Have added a  iframe to the html 


Refused to execute inline script 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:*". Either the 'unsafe-inline' keyword, a hash ('sha256-xlu0aRT09nd46GNgGXfmVGth2oz6N8swSoCVqzIYhkk='), or a nonce ('nonce-...') is required to enable inline execution.

Patrick Kettner

unread,
Aug 10, 2023, 11:46:41 AM8/10/23
to Vanessa Dias, Chromium Extensions
With manifest v3, you can't execute an inline script. Without code, its hard to undersatnd the exact violation being hit, but I assume you are inserting a script that creates an iframe? Rather than doing that, use chrome.scripting.executeScript to inject the script to modify the DOM.

--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/a1006426-82ed-4b7f-9bb1-2faed6412e13n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages