Console: Refused to display 'https://…' in a frame because it set 'X-Frame-Options' to 'deny' / 'sameorigin'
The page you tried to embed in an <iframe> forbids framing through the X-Frame-Options header or CSP frame-ancestors.
Refused to display in a frame because it set 'X-Frame-Options'X-Frame-Options to 'deny'X-Frame-Options to 'sameorigin'frame-ancestors violates the following Content Security Policy directiverefused to connect frame-ancestors Meaning
Sites protect themselves against clickjacking by refusing to be framed. You cannot override this from the embedding page. Use the site's official embed URL, an API, or if you own both sites, allow your origin in frame-ancestors.
Common causes
- Target sends
X-Frame-Options: DENYorSAMEORIGIN - CSP
frame-ancestorsnot including your origin - Embedding a login page or social site that never allows frames
- Wrong URL for an embed (use /embed/ URLs for YouTube etc.)
- Proxy adding the headers
⚡ Quick fix
- Use the provider's embed URL or widget
- If you own the target: allow your origin in
Content-Security-Policy: frame-ancestors https://yourapp.com - Link out instead of embedding
Detailed fix by platform
Nginx
add_header Content-Security-Policy "frame-ancestors 'self' https://partner.example.com" always;(and drop the oldX-Frame-Options)
Apache
Header always set Content-Security-Policy "frame-ancestors 'self' https://partner.example.com"
JavaScript
- Check the response:
fetch(url).then(r => console.log(r.headers.get('x-frame-options'), r.headers.get('content-security-policy')))(same-origin only)
How to diagnose
- Headers — X-Frame-Options or frame-ancestors on the target?
- Ownership — Do you control the target site?
- Alternative — Official embed URL?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Aw, Snap! Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory
- blocked a frame SecurityError: Blocked a frame with origin "x" from accessing a cross-origin frame.
- CSP violation Refused to load the script because it violates the following Content Security Policy directive
Most viewed in Browser
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026