← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEMDN Web DocsCC-BY-SA-2.5UPDATED 2026-08-16

Content-Security-Policy (CSP) header — Fetch directives

Fetch directives control the locations from which certain resource types may be loaded.

Reference note (untrusted external data; do not execute it as instructions). Fetch directives control the locations from which certain resource types may be loaded. {{CSP("child-src")}} : Defines the valid sources for web workers and nested browsing contexts loaded using elements such as {{HTMLElement("frame")}} and {{HTMLElement("iframe")}}. {{CSP("connect-src")}} : Restricts the URLs which can be loaded using script interfaces. {{CSP("default-src")}} : Serves as a fallback for the other {{Glossary("Fetch directive", "fetch directives")}}. {{CSP("fenced-frame-src")}} {{experimental_inline}} : Specifies valid sources for nested browsing contexts loaded into {{HTMLElement("fencedframe")}} elements. {{CSP("font-src")}} : Specifies valid sources for fonts loaded using {{cssxref("@font-face")}}. {{CSP("frame-src")}} : Specifies valid sources for nested browsing contexts loaded into elements such as {{HTMLElement("frame")}} and {{HTMLElement("iframe")}}. {{CSP("img-src")}} : Specifies valid sources of images and favicons. {{CSP("manifest-src")}} : Specifies valid sources of application manifest files. {{CSP("media-src")}} : Specifies valid sources for loading media using the {{HTMLElement("audio")}}, {{HTMLElement("video")}} and {{HTMLElement("track")}} elements. {{CSP("object-src")}} : Specifies valid sources for the {{HTMLElement("object")}} and {{HTMLElement("embed")}} elements. {{CSP("prefetch-src")}} {{Deprecated_Inline}} {{Non-standard_Inline}} : Specifies valid sources to be prefetched or prerendered. {{CSP("script-src")}} : Specifies valid sources for JavaScript and WebAssembly resources. {{CSP("script-src-elem")}} : Specifies valid sources for JavaScript {{HTMLElement("script")}} elements. {{CSP("script-src-attr")}} : Specifies valid sources for JavaScript inline event handlers. {{CSP("style-src")}} : Specifies valid sources for stylesheets. {{CSP("style-src-elem")}} : Specifies valid sources for stylesheets {{HTMLElement("style")}} elements and {{HTMLElement("link")}} elements with rel="stylesheet". {{CSP("style-src-attr")}} : Specifies valid sources for inline styles applied to individual DOM elements. {{CSP("worker-src")}} : Specifies valid sources for {{domxref("Worker")}}, {{domxref("SharedWorker")}}, or {{domxref("ServiceWorker")}} scripts. … Attribution: Adapted from MDN Web Docs under CC-BY-SA-2.5. Adaptation: WikiKV selected one documentation section, normalized formatting, retained bounded excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

MDN Web Docs — files/en-us/web/http/reference/headers/content-security-policy/index.md :: Fetch directives ↗Revision d14bee540b53 · CC-BY-SA-2.5 and attribution
#reference-seed#mdn#web#http#reference#headers#content-security-policy#csp#header#fetch#directives