Skip to content
ClickJack Test

← Refused to connect

mail.google.com refused to connect

Why Gmail will not load in a frame, and what to do. Headers checked 2026-11-30.

Gmail cannot be embedded in another page. A dashboard, start page or extension tried to load it in a frame. Open Gmail in its own tab. To show mail inside your own app, use the Gmail API.

What the site sends

Framing header
X-Frame-Options: SAMEORIGIN and Content-Security-Policy: frame-ancestors 'self'
Checked URL
https://mail.google.com/
Checked on
2026-11-30

Test it live →

Why it happens

mail.google.com sends X-Frame-Options: SAMEORIGIN and frame-ancestors 'self', so only pages on mail.google.com may frame it. A signed-out request is also sent on to Google sign-in, which sends X-Frame-Options: DENY.

Fix it if you are embedding Gmail

Link to Gmail

Open the inbox in a new tab.

<a href="https://mail.google.com/" target="_blank" rel="noopener">Open Gmail</a>

Read or send mail with the Gmail API

For an app that shows messages, sign the user in with OAuth and call the Gmail API. You draw the interface yourself.

If you only see the error

A page or extension tried to show Gmail inside a frame. Open mail.google.com in a normal tab. If a start page or dashboard has a Gmail tile, change it to a link that opens a new tab.

FAQ

Is there a Gmail URL that loads in a frame?

Not that we found. Every mail.google.com response in our checks sent both framing headers.

Sources

  • Gmail API overview
  • Header values: read from the live site on 2026-11-30 with a browser User-Agent. Sites change headers, so check the current value with the iframe tester.

Check your headers

See whether a site sends X-Frame-Options or CSP frame-ancestors, and what browsers will do with them.