files/en-us/web/http/reference/headers/content-security-policy/child-src/index.md
The HTTP {{HTTPHeader("Content-Security-Policy")}} (CSP)
child-src directive defines the valid sources for web workers and nested browsing
contexts loaded using elements such as {{HTMLElement("frame")}} and
{{HTMLElement("iframe")}}. For workers, non-compliant requests are treated as fatal
network errors by the user agent.
Content-Security-Policy: child-src 'none';
Content-Security-Policy: child-src <source-expression-list>;
This directive may have one of the following values:
'none'
<source-expression-list>
Given this CSP header:
Content-Security-Policy: child-src https://example.com/
This {{HTMLElement("iframe")}} and worker are blocked and won't load:
<iframe src="https://not-example.com"></iframe>
<script>
const blockedWorker = new Worker("data:text/javascript,…");
</script>
{{Specifications}}
{{Compat}}