Headerwise

Show a site in an iframe for testing

You embed a page in an iframe and get a blank frame, or "refused to connect", with a console message about X-Frame-Options or frame-ancestors. The page told the browser not to be framed by other sites. That protects its users from clickjacking, so the right fix is usually on the page's side.

The two headers that block it

The proper fix: allow your origin

If you own the framed page, list the sites that may frame it: Content-Security-Policy: frame-ancestors 'self' https://app.example.com, and drop X-Frame-Options. For local development, add http://localhost:3000 in your dev config only.

For testing: remove the headers in the browser

When you can't change the framed page (a third-party widget, a staging site), a header extension can remove those response headers in your browser only. In Headerwise, the Allow the site in an iframe preset removes X-Frame-Options and Content-Security-Policy. Then:

  1. add an only on filter for the framed site, so other sites keep their protection;
  2. reload the page with the iframe.
Removing Content-Security-Policy removes all of it, not only frame-ancestors: the page loses its script and style restrictions too while the profile is on. Keep it to the one site, and switch the profile off when you're done (or let it switch itself off with "On for 15 minutes").

Still blank?