Why does not the iframe open some sites?

1

Can anyone explain why some sites do not open in <iframe> and if there is a similar solution to <iframe> ?

Google and PagSeguro , for example, do not open.

<iframe src="https://www.google.com.br"style="width: 100%; height: 100%;"></iframe>
    
asked by anonymous 30.04.2015 / 15:58

2 answers

3

Google and other sites use X-Frame-Options , a way to prevent Clickjacking , which is a kind of theft of clicks to make the user think that they are doing an action on a particular site, but in fact the clicks performed on that action are being used by the attacker to perform malicious operations.

They are applied in the HTTP header of the server for these attacks via <frame> , <iframe> or <object> .

I think one way to get over this is by using proxy , but this will not tell you how to do it.

    
30.04.2015 / 16:22
0

You can implement javascript code that detects if the site is being opened in an iframe. I do not know if google uses this mechanism, but if you use it, this may be the case.

There are also similar mechanisms for PHP and probably other server-side languages, although they are not as reliable.

    
30.04.2015 / 16:10