Find the header that blocks your page or file from loading

ERR_BLOCKED_BY_RESPONSE means Chrome received a response but the response's own headers forbid using it where it was loaded. In an iframe, the framed page sent X-Frame-Options or a Content-Security-Policy frame-ancestors rule that excludes the page embedding it, or the embedding page sets Cross-Origin-Embedder-Policy and the framed page sends none. For an image, classic script or other file loaded from another origin without CORS, the file sent Cross-Origin-Resource-Policy, or the page loading it set Cross-Origin-Embedder-Policy and the file gave no permission.

Which header blocked the response

  • A frame blocked by the X-Frame-Options header

    The framed page sends X-Frame-Options: DENY, which no frame may show, or SAMEORIGIN, which only pages on the same origin may frame. Chrome draws an error inside the frame saying the site refused to connect, and the console names the header and its value.

  • A frame blocked by frame-ancestors

    The framed page's Content-Security-Policy has a frame-ancestors list that leaves out the embedding page. 'self' admits only the same origin, and 'none' admits no one, much like X-Frame-Options: DENY.

  • A frame without an embedder policy

    When your page sends Cross-Origin-Embedder-Policy, the policy reaches its iframes too, and each framed page has to send require-corp or credentialless in a Cross-Origin-Embedder-Policy header of its own, unless the iframe tag carries the credentialless attribute. A framed page without one is blocked with this error.

  • A file blocked by its resource policy

    An image, classic script, video or other file loaded without CORS and sent with Cross-Origin-Resource-Policy: same-origin or same-site can't be embedded by pages outside that boundary. Chrome logs it as ERR_BLOCKED_BY_RESPONSE.NotSameOrigin, or ERR_BLOCKED_BY_RESPONSE.NotSameSite when the header says same-site. Fonts and module scripts load in CORS mode, where this header doesn't apply, so a blocked font is a CORS error instead.

  • A file blocked by the embedder policy

    When your page sends Cross-Origin-Embedder-Policy: require-corp, every cross-origin file it loads without CORS needs a Cross-Origin-Resource-Policy header that allows it. Files without one fail with a longer NotSameOrigin variant that ends in ByCoep.

Chromium's net_error_list.h names X-Frame-Options, frame-ancestors and Cross-Origin-Resource-Policy as causes, ancestor_throttle.cc writes the X-Frame-Options console message, navigation_request.cc blocks a framed page that lacks the embedder policy its parent requires, and blocked_by_response_reason.mojom lists each variant. MDN covers X-Frame-Options, frame-ancestors, Cross-Origin-Resource-Policy and Cross-Origin-Embedder-Policy.

See which headers block it

# Show the framing and embedder headers of the page you're trying to embed
curl -sS -o /dev/null -D - https://yoursite.com/booking \
  | grep -i -E '^(x-frame-options|content-security-policy|cross-origin-embedder-policy):'

# Show the resource policy of a file loaded from another origin
curl -sS -o /dev/null -D - https://cdn.yoursite.com/logo.png \
  | grep -i '^cross-origin-resource-policy:'

# Show the embedder policy of the page doing the loading
curl -sS -o /dev/null -D - https://yoursite.com/ \
  | grep -i '^cross-origin-embedder-policy:'

Read the headers

  • For a frame, frame-ancestors wins: when a page sends both headers, the CSP specification says X-Frame-Options is ignored. So a frame-ancestors list is the place to allow an embedding page, for example frame-ancestors 'self' https://partner.yoursite.com. Both only work as HTTP headers: MDN notes that neither X-Frame-Options nor frame-ancestors takes effect from a meta tag. If the embedding page sends Cross-Origin-Embedder-Policy, the framed page's own cross-origin-embedder-policy line has to show up in the first command too.

  • For a file, same-origin allows only the exact origin, same-site lets your other subdomains in too, and cross-origin allows any site. A file with no Cross-Origin-Resource-Policy header at all fails only when the loading page demands one through Cross-Origin-Embedder-Policy.

How to fix a blocked frame or file

  1. Decide who may embed the pageList the exact origins that should be able to frame it, and keep blocking everyone else, since these headers exist to stop other sites framing your page for clickjacking.
  2. Allow those origins with frame-ancestorsSend a frame-ancestors list with 'self' and each allowed origin. Current browsers follow it over X-Frame-Options, so you can keep X-Frame-Options for older ones.
  3. Set a resource policy on shared filesFiles meant for other sites, such as images on a CDN subdomain or an embeddable widget's script, should send Cross-Origin-Resource-Policy: cross-origin, or same-site if only your own subdomains load them.
  4. Meet a strict embedder policyIf your page needs require-corp, give each cross-origin file a resource policy header, or load it in CORS mode with the crossorigin attribute. Switching the policy to credentialless also works, and loads such files without cookies. Framed pages need an embedder policy of their own, or the credentialless attribute on their iframe tag.

Frequently asked questions

Why does my iframe say the site refused to connect?

That message is Chrome's error page for ERR_BLOCKED_BY_RESPONSE inside a frame, as Chromium's error page code sets it, though Chrome uses the same words when a server refuses the connection outright. When X-Frame-Options or frame-ancestors refused the frame, the console also shows a message naming the header or directive, which tells the two apart. If you run that site, add your page to its frame-ancestors list; if you don't, link to it instead, since only its owner can change the headers.

Is this a CORS error?

No. CORS errors come from requests made in cors mode, such as fetch calls, and carry their own console messages. This error comes from X-Frame-Options, frame-ancestors, Cross-Origin-Resource-Policy or Cross-Origin-Embedder-Policy, which govern frames and files loaded without CORS, such as a plain img tag. The CORS guide, linked below, covers the other case.