IFRAME: Refused to display document because display forbidden by X-Frame-Options [duplicate]
Asked Answered
D

1

4

Possible Duplicate:
Overcoming “Display forbidden by X-Frame-Options”

I have this HTML code on a server (Heroku). From the iframe of www.example.com I click on the "login to google" button, but I get this error message:

Refused to display document because display forbidden by X-Frame-Options

I tried adding the <meta http-equiv="X-Frame-Options" content="GOFORIT"> on the header of www.example.com but still doesn't work. Any ideas? Thanks

<html>
<head>
<title>Test</title>
</head>
<body>
<iframe src="http://www.example.com" width=1000 height=1000></iframe>
</body>
</html>
Downey answered 12/11, 2012 at 0:4 Comment(1)
may be have a look on this thread #6666923 I tested and Its working fine on my side.Herrick
W
5

You have to use real HTTP response headers. <meta http-equiv> isn't really equivalent.

How you set those depends on your server and/or server side programming language.

e.g. for Apache, with mod_headers:

Header set X-Frame-Options GOFORIT

… will do the job.

Waechter answered 12/11, 2012 at 8:6 Comment(4)
Thanks. What would this HTTP response header be like for GWT?Downey
The response header would be the same for any system — X-Frame-Options: GOFORIT — how you set response headers in GWT, I have no idea.Waechter
Just to be clear, should I include that header on www.example.com (server side) or on the website that contains the iframe (server side)?? Thanks againDowney
The website that is being put in the frame.Waechter

© 2022 - 2024 — McMap. All rights reserved.