Error messages · Chrome extension
Refused to execute inline script (Content Security Policy)
What you see
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'".
Why it happens
Extension pages (popup, options) can’t run JavaScript written inside the HTML. ChatGPT often puts a <script> block straight into popup.html.
The fix
- rightsocket does this Moves inline <script> blocks into their own .js file and links it.
- You do this onclick="…" attributes are also blocked: they are marked Check, and need to become addEventListener calls.
Sources
Other chrome extension errors
- Manifest version 2 is deprecated
- Service worker registration failed. Status code: 15
- Manifest is not valid JSON
- Could not load icon specified in the manifest
- chrome.browserAction is undefined (Manifest V3)
- 'browser_action' requires manifest version of 2 or lower
- 'webRequestBlocking' requires manifest version of 2 or lower
- Permission is unknown or URL pattern is malformed
- Invalid value for 'web_accessible_resources[0]'