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)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.