Question

When I put up our maintenance page, I include some links to our contact us, a link to our twitter feed for more details, etc. However, I just noticed that (at least in chrome) the links don't open. It's clearly due to the page being hosted from within an iframe.

The following error shows up in the console: Refused to display document because display forbidden by X-Frame-Options.

We're hosting our maintenance page on S3, as heroku suggests. This limits our ability to modify headers, etc. Any suggestions on how to get these links to work?

Thanks in advance

Was it helpful?

Solution

I just encountered the same issue. I worked around it using target='_blank'.

OTHER TIPS

I think your problem could be related to headers in the response of your links.

https://developer.mozilla.org/en-US/docs/The_X-FRAME-OPTIONS_response_header

I don't know if Heroku configures the server with those headers by default or your app adds them. But at least, you got something to chew on.

HTH!

You can set the target attribute on each anchor tag to "_parent" in order to open the link in the parent frame:

<a target="_parent" href="http://example.com">click here</a>

Alternatively, you could use a base tag in the head of the page to define the target attribute for all links in the page:

<base target="_parent">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top