How to Show Google.Com in an Iframe

How to show google.com in an iframe?

The reason for this is, that Google is sending an "X-Frame-Options: SAMEORIGIN" response header. This option prevents the browser from displaying iFrames that are not hosted on the same domain as the parent page.

See: Mozilla Developer Network - The X-Frame-Options response header

can't add google.com as src to an IFrame

Google sets the x-frame-options response header to SAMEORIGIN

https://developer.mozilla.org/en-US/docs/The_X-FRAME-OPTIONS_response_header

Why does google.com not load in an iFrame

Because it has X-Frame-Options Header policy and browsers tend to respect those policies.

Read here and here

The "X-Frame-Options" allows a secure web page from host B to declare
that its content (for example a button, links, text, etc.) must not
be displayed in a frame of another page (e.g. from host A). In
principle this is done by a policy declared in the HTTP header and
obeyed by conform browser implementations.



Related Topics



Leave a reply



Submit