nsx1luke
nsx1luke

Reputation: 33

Iframe not showing on all websites

In http://localhost i have put in the index.html file this:

<iframe src="https://google.com" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
    Your browser doesn't support iframes
</iframe>

But it just shows the sad face.

Any help would be good

Thanks

Upvotes: 0

Views: 1171

Answers (2)

user128511
user128511

Reputation:

If you open the JavaScript console in your browser you should see an error something like this

Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

That means google's server is telling your browser not to allow displaying google.com in an iframe

Upvotes: 1

ceejayoz
ceejayoz

Reputation: 179994

Google.com prevents framing via the X-Frame-Options header.

Most large sites will do the same.

It's also possible to use a Content Security Policy to prevent framing.

Upvotes: 2

Related Questions