Find the header that blocks your page or file from loading
ERR_
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_
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-originallows only the exact origin,same-sitelets your other subdomains in too, andcross-originallows 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
- 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.
- 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.
- 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.
- 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_
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.
Check the headers that control embedding
- Website reliabilityHear about it when your site goes down, not days later from a customer.
- ClickjackingSet framing rules so another site can't freely place your page behind its own controls.
- Content Security PolicyRead your content policy and investigate blocked scripts before tightening it.
- CORSReview cross-site read permissions without opening private responses to every origin.