1

i am trying to load external website on my webpage using i frame but its giving following error on console.

here is my code

 <body>
  <iframe src="https://firebase.google.com/"> </iframe>
 </body>

error on console

Refused to display 'https://firebase.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

i try different solution but its not working .how to solve this problem?

  • It's [not possible](https://stackoverflow.com/a/3045101/2581562) – Legends Jan 06 '18 at 17:31
  • 2
    Possible duplicate of [How to set 'X-Frame-Options' on iframe?](https://stackoverflow.com/questions/27358966/how-to-set-x-frame-options-on-iframe) – Ward Jan 06 '18 at 17:47

2 Answers2

0

Based on the error I think you need to change the 'X-Frame-Options' to allow the site to be loaded (if you have access to the server). Follow this link to know how to do that.

However, if the domain that you are trying to access is setting the 'X-Frame-Options' to sameorigin then you can't display it in an iframe. This question is similar to yours. Have a look at it.

0

You can't.

The X-Frame-Options header is meant precisely to prevent the page from being loaded in an iframe. e.g. to prevent clickjacking attacks.

Ward
  • 2,799
  • 20
  • 26