Iframe tester
Check if a page can be shown in an iframe. See which header blocks it, who may still frame it, and a live preview.
What the tester checks
Our server requests the URL, follows redirects, and reads two response headers: X-Frame-Options and Content-Security-Policy. From them it tells you if other sites can frame the page, which header blocks it, and who is still allowed.
Then your browser loads the page in a frame below the result. A script can't tell if a frame from another site was blocked, so the header check is the answer and the frame is a visual check.
Why sites block framing
The main reason is clickjacking. An attacker loads a page in a hidden frame on top of their own site. Visitors think they click the attacker's page, but the click lands on the hidden one: a buy button, a delete button, a permission prompt. Blocking frames stops this, so many sign-in, banking and account pages block them.
The two headers
- X-Frame-Options
- The older header.
DENYblocks every site.SAMEORIGINallows only pages on the same origin.ALLOW-FROMis obsolete, and current browsers ignore the whole header when they see it. - Content-Security-Policy: frame-ancestors
- The current standard.
'none'blocks every site,'self'allows the same origin, and a list of sites allows only those. When a page sendsframe-ancestors, browsers ignore X-Frame-Options.
What "refused to connect" means
When one of these headers blocks a frame, Chrome and Edge show "host refused to connect" inside it. The browser did reach the server. It refused to show the response because of the header. Other browsers show a blank frame or their own error page.
In the developer console, Chrome reports ERR_BLOCKED_BY_RESPONSE or "Refused to display in a frame". For YouTube, Google Docs and other common sites, see refused to connect fixes.
FAQ
Why does the page open in a new tab but not in a frame?
X-Frame-Options and frame-ancestors only apply when the page is inside a frame. A normal visit in a tab is not affected, so the same URL works there.
Can an iframe attribute or a meta tag get around the block?
No. The page you embed sends the header, and the browser obeys it. No attribute on your <iframe> changes that, including sandbox and allow. A <meta> tag can't set either header: browsers ignore X-Frame-Options and frame-ancestors in meta tags. Only the site that sends the header can change it.
Why won't http pages load in the preview?
This site uses https. Browsers block http content inside an https page (mixed content), and frames are always blocked. The same happens on your own https site, so serve the embedded page over https.
What does the sandbox on the preview change?
The preview frame has a sandbox attribute that allows scripts, forms, the page's own cookies and storage, and links that open a new tab. It leaves out top navigation, so a page can't redirect this tester away. It also blocks alert dialogs, and Chrome, Edge and Firefox block downloads. A few pages that need those features may behave differently here than in a plain iframe. The sandbox does not change whether the frame is blocked.
The tester says it can be embedded, but the frame looks wrong. Why?
Some pages use scripts to detect that they are in a frame. Others need a sign-in: Safari blocks cookies in frames from other sites by default, and Firefox keeps them separate per site, so you may see a signed-out page. Our check also requests the page without your cookies, and a server can send different headers to a signed-in browser. The preview shows what your browser actually gets.