Skip to content
ClickJack Test

← Refused to connect

drive.google.com refused to connect

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

A Google Drive page in a frame got a response that blocks framing. To embed a file, use its /preview URL (Drive calls this Embed item) and share the file with anyone who has the link. If you only use Drive or an add-on, you are most likely signed in to more than one Google account.

What the site sends

Framing header
Redirects a signed-out request to Google sign-in (accounts.google.com), which sends X-Frame-Options: DENY
Checked URL
https://drive.google.com/
Checked on
2026-11-30

Test it live →

Why it happens

The browser names the host whose response blocked the frame. Drive decides per request, based on the URL and on who is signed in. In our signed-out check, the Drive home page sent the frame to Google sign-in, which sends X-Frame-Options: DENY. If your error names accounts.google.com instead, that is what happened.

For a single file, Drive gives you an embed code that points to the file's /preview URL.

Fix it if you are embedding Google Drive

Embed a file with /preview

Open the file in Drive, open the three-dot menu and choose "Open in new window". In the new window, open the three-dot menu again and choose "Embed item". The code uses the /preview URL. You can also replace /view and everything after it with /preview yourself.

<iframe src="https://drive.google.com/file/d/FILE_ID/preview"
  width="640" height="480"></iframe>

Set sharing to "Anyone with the link"

A restricted file cannot show to signed-out visitors. Open Share, set General access to "Anyone with the link", and test your page in a private window.

If you only see the error

Being signed in to more than one Google account is a common cause. Google may not know which account the frame should use, and can fall back to your default account. If that account cannot open the file, the frame cannot show it. Open the page in a private window and sign in with only the account that has access. To fix it for good, sign out of every Google account, then sign in first with the one you need: in many cases Google treats the first account you sign in with as the default.

If you use one account and it still fails, check third-party cookies. A frame from Google on another site is third-party, so a browser setting or an extension that blocks third-party cookies hides your Google session from it. Allow third-party cookies for the site you are on, or turn the blocking extension off for it.

FAQ

Why does a Google Sheets add-on show "drive.google.com refused to connect"?

Add-ons and pickers show Drive in a frame. Add-on makers such as Coupler.io trace this error to how Google handles several signed-in accounts. Their fix: sign out of every Google account, then sign in first with the account that installed the add-on.

Can I embed the normal Drive interface?

Google offers no embed for My Drive or the file list. Embed single files with /preview, or link to the folder.

Check your headers

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