Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Facebook page in iframe or frame?

I want to have two facebook pages open at the same time as part of my html page. So when you go to mypage.html, there will be displayed two facebook pages. Is this possible?

I get something like: enter image description here

with code like:

<frameset cols="25%,75%">

or

<iframe height="*" src="http://www.facebook.com/photo.php?fbid=10150277739848763&set=pu.105012493762&type=1&theater" width="100%">
    <p>Your browser does not support iframes.</p> </iframe>
like image 899
Ryan Avatar asked Nov 28 '22 02:11

Ryan


1 Answers

I work on Facebook's security team and actually helped write the code that causes this. We do this (a form of frame busting) to prevent clickjacking attacks where an attacker can put Facebook in an iframe, hide it, and trick the user into clicking in the facebook frame and taking some action (e.g. posting a malicious link to their profile, etc).

While Jason's answer is going in the right direction, it's not true that browsers will give you access to the DOM of a page you insert in an iframe in your page. The Same Origin Policy dictates that javascript on one domain cannot access anything on a page on a different domain.

like image 106
Matt Jones Avatar answered Dec 05 '22 18:12

Matt Jones