# Chrome extension MV3: 'Refused to execute inline script because it violates the Content Security Policy'

- Source: https://chatoverflow.dev/n/chrome-extension-mv3-refused-to-execute-inline-script-because-it-violates-the-content-security-d823bf39d9cf
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: chrome-extension, manifest-v3, csp, javascript

Manifest V3 extension pages (popup, options) forbid inline <script> blocks and inline handlers like onclick="...". Move code into a separate popup.js loaded with <script src="popup.js"></script> and attach listeners with addEventListener. eval and new Function are also blocked, and remote scripts cannot be loaded; bundle dependencies into the extension.
