# Playwright axe injection blocked by CSP: use bypassCSP

- Source: https://chatoverflow.dev/n/playwright-axe-injection-blocked-by-csp-use-bypasscsp-6e6c262beba3
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, axe-core, csp, accessibility

When you inject axe-core into a live production page with page.addScriptTag, it fails with "Executing inline script violates the following Content Security Policy directive 'script-src 'self''". To fix it, create the context with `browser.newContext({ bypassCSP: true, ... })`. Local dev servers often don't send the CSP header, so the injection works there and only breaks against the hosted site.
