The fix, in one snippet
1. chrome://settings/help (Firefox: Menu > Help > About Firefox)
Restart the browser if an update is waiting
2. chrome://extensions (Firefox: About:addons)
Disable anything that rewrites headers or blocks scripts
3. Re-run the browser check
Illustrative values. Change the paths, hostnames and options to match your own site before using it.
The sections below explain what is tested, why it matters and the alternatives.
What we test
The scan loads a probe page in an iframe. The probe is served with Content-Security-Policy: default-src 'none'; script-src 'nonce-<random>'; img-src 'self' and contains three things: an inline script without a nonce that would set a flag, a nonced script that listens for the securitypolicyviolation event and posts results to the parent, and an image from a disallowed origin. The check passes when the un-nonced script did not run, a violation event fired with blockedURI of inline, and the image failed to load. The nonced script also calls eval() inside a try/catch to confirm 'unsafe-eval' is blocked. Limits: violations raised by your own extensions injecting scripts are filtered out by matching the event's sample to our test script; the check reflects your browser plus its extensions, not the policies of sites you visit.
Why it matters
CSP is the main defence in depth against cross-site scripting: even if an attacker gets markup into a page, the browser refuses to run script the policy did not authorise. A browser that does not enforce it turns every site's CSP into decoration. In practice this failure comes from extensions that disable CSP (a developer convenience left on), from adware that strips CSP so it can inject its own scripts into every page, and from content-rewriting proxies. Old browsers without CSP Level 2 support are rare now.
How to fix it
Update the browser. Look for extensions described as "disable CSP", "CSP bypass" or header editors and remove them or scope them to the sites you develop on. Rerun the scan in a private window with extensions disabled; if it passes there, an extension is responsible. If it fails even then, check the system proxy settings and run a malware scan, since adware commonly strips this header. Site owners: see the CSP presence check, weak CSP directives and the practical CSP guide. The attack it prevents is described in cross-site scripting explained.
Where this fits
Browser enforces Content-Security-Policy is check 1 of 16 that the browser security & privacy check runs under browser privacy and policy enforcement, ordered the way they are worth fixing. That ordering is the point: Fixing this one while the check above it still fails buys less than it looks like.
What fixing this still leaves open
Browser enforces Content-Security-Policy closes one route in. Immediately below it: Browser version is out of date, where your browser is behind the current stable release, so it is missing security fixes for bugs that attackers already know how to exploit; WebRTC IP address leak, where webRTC revealed an IP address that differs from the one your connection uses, typically your real address behind a VPN or proxy; Browser enforces X-Content-Type-Options, where your browser executed a script that was served with a non-script content type and X-Content-Type-Options: Nosniff, so it is guessing file types where it should refuse.
The first few lines
You are a senior web engineer. I ran a security and SEO scanner against my site and it reported the finding below. Fix it properly rather than suppressing the symptom.
Finding: Browser enforces Content-Security-Policy (high severity)
Scanner check id: csp-enforcement
What this check tests: Your browser ran an inline script on a page whose Content-Security-Policy forbids it, so the cross-site scripting protection that CSP gives sites is not working in your browser.
The rest of this prompt names the pages and line numbers we found the problem on, the configuration to change, and the constraints a good answer has to respect. It is free, it just needs an account so the work is not scraped wholesale.
Sign in with GoogleSigning in is free and takes one click. We store your email address and nothing else.
References
Related guides
9 min read · Updated Sep 16, 2026
Content Security Policy (CSP): A Practical Guide to Writing One That Works
A Content Security Policy tells the browser which scripts, styles and resources a page may load, which defeats most cross-site...
Read the guide
8 min read · Updated Sep 19, 2026
Cross-Site Scripting (XSS) Explained: Reflected, Stored, DOM-Based and How to Prevent It
XSS lets an attacker run their own script in your users' browsers. The three types, what an attacker does with it and the layered...
Read the guide