Chrome -- Getting Started
SCP (Content Security Policy)
The core logic is here.
- If the directive contains _, it allows HTTP family protocols (http/https) or URLs matching the current page’s scheme. This is why
script-src _
allows scripts from any HTTP/HTTPS source. - If directive contains ‘self’, check if URL matches the current origin.
- Check against explicitly listed sources (like https://example.com)
- Special handling for WebSocket URLs with wildcards.
Blink
This post is licensed under CC BY 4.0 by the author.