Reputation:
hi i have a problem with iFrame, i have to create an application which want to enter any address to text box and the site will load to iFrame, but the problem with some sites like facebook and google, they didn't load to the iFrame, i use PHP for create this, anyone know how can facebok and gogle load into iFrame with their styles
Upvotes: 0
Views: 1066
Reputation: 89342
Both Google and Facebook make use of the X-Frame-Options
HTTP response header in order to prevent their sites from being framed by a site on another domain.
X-Frame-options is only recognized by "newer" browsers. But don't get excited just yet, there are way to prevent frame in those browsers as well. Jeff Atwood (co-founder of Stack Overflow and the Stack Exchange network) has talks about frame busting on his blog.
The reason websites need to prevent framing is that iframes (and frames) allow for a malicious attack known as clickjacking. Clickjacking is:
a malicious technique of tricking a Web user into clicking on something different to what the user perceives they are clicking on, thus potentially revealing confidential information or taking control of their computer while clicking on seemingly innocuous web pages.
Upvotes: 1
Reputation: 8700
You can't do that. Including another site inside your iframe could be considered an attack (you could modify their ui using JS, or steal clicks or other similar not-so-good things), so they're protected against it.
Edit
I would suggest you read up on framekillers
Upvotes: 0