How to embed a facebook page in an iframe?
Solution 1
I belive facebook as an anti framing script. It detects if it is within a iframe and shows a logo which when you click on takes you out of the iframe. Maybe they have an sdk which allows authenticate first and then it will allow the iframe. I Don't know.
More Info: http://developers.facebook.com/search?q=Fb:iframe
Solution 2
I know this is a bit old - but it came up in my search when I was looking for a similar answer. You can get the code to embed an iframe containing public posts, comments etc (a bit like YouTube embed) from this page: https://developers.facebook.com/docs/plugins/embedded-posts/ using the social plugins. I don't think Facebook will ever allow you to iframe the whole site though.
Solution 3
You can proxy the request through your server. Basically request the url from your server https://example.com?url=facebook.com and then write some logic to have your server request all the urls needed to load the page. I wouldn't recommend this for anything commercial however as it wouldn't make facebook happy.
A better solution would be to use the facebook iframe. You can programatically convert any fb page url into the url fb allows you to insert into an iframe. Check their docs for more info. For fb pages it works perfectly.
millebii
Founder of my own company in Semantical search domain. Also working on answer engines. And incidentally created a http://www.biible.info the Bible commentary search engine.
Updated on August 11, 2021Comments
-
millebii over 2 years
For my application I need to embed Facebook page in an iframe, here is the html code:
<html> <head></head> <body> <iframe src="http://www.facebook.com" style="width:100%;height:100%"> </body> </html>
But it does not work, any idea why and how to circumvent ?