About this tool
Assemble a Content-Security-Policy header string from common directives prefilled with 'self'; the header is built entirely in your browser.
One box is provided for each of seven directives: default-src, script-src, style-src, img-src, font-src, connect-src and frame-src, each starting with 'self'. Each box is trimmed and its whitespace collapsed, empty boxes are skipped, and the rest are joined with a semicolon and space after "Content-Security-Policy: ".
Values are not validated: they are copied as typed, so you add the quotes around keywords like 'self' yourself. Other directives such as base-uri or frame-ancestors are not available. Copy includes the header name.