Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why facebook is not working in Iframe

Facebook.com is not running in I frame anyone now the reason.

<iframe name="iframe1" src="http://www.facebook.com"></iframe>
like image 952
Epdr Avatar asked Jan 08 '23 02:01

Epdr


1 Answers

Facebook.com doesn't allow for it's main page to be included in iframe, because they set X-Frame-Options HTTP header to DENY.

If you look in your console, you'll see:

Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'DENY'.

If you want to get around this you can:

  1. If you develop only for yourself, you can use browser plugin, for example: https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe

  2. However, it'd be best if you'll just use plugins they've exposed for developers: https://developers.facebook.com/docs/plugins.

like image 118
Daniel Kmak Avatar answered Jan 10 '23 18:01

Daniel Kmak