Search and jump to any tool. Type to filter; use arrow keys to move and Enter to select.
A Content-Security-Policy header tells the browser which sources of scripts, styles, images and frames a page may use, which limits the damage of an injected script.
A Content-Security-Policy header tells the browser which sources of scripts, styles, images and frames a page may use, which limits the damage of an injected script. This editor starts from a strict policy, lets you switch directives on and off and add sources, and warns about choices that weaken the result.
Select Reset to strict preset
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; font-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests
Good to know. Directive order is fixed, so the same choices always give the same header. The tool builds the string only and does not detect what your pages load.
Content-Security-Policy-Report-Only before enforcing it.Fallback for every fetch directive you do not set explicitly.
Where JavaScript may be loaded from.
Where stylesheets may be loaded from.
Where images may be loaded from.
Targets allowed for fetch, XHR, WebSocket and EventSource.
Where web fonts may be loaded from.
Sources for <object>, <embed> and <applet>. Prefer 'none'.
Restricts the URLs a <base> element may set.
Where forms are allowed to submit.
Who may embed this page in a frame.
Rewrites http:// subresource requests to https://.