PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, November 30, 2022

[FIXED] How to prevent a web-page from knowing that it is loaded inside an iframe?

 November 30, 2022     html, iframe, javascript     No comments   

Issue

In the wake of this famous question: How to identify if a webpage is being loaded inside an iframe or directly into the browser window?

I have an opposite practical issue: is there any way (workable in all browsers) to prevent a web-page from knowing that it is loaded inside an iframe element?

This is useful for various preview interfaces, where some particular websites block their content if they are loaded inside an iframe.


Solution

There is no way to get this information. The reason that websites should always be able to know they're in an iframe is for security reasons.

It allows for things like frame-busting, where a website stops itself from being displayed or redirects to the site itself.

If a website were to be shown in an iframe without knowledge of this, I could overlay a separate form element and use this in phishing attacks.

That would be a serious security issue.



Answered By - Alexander Varwijk
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing