iframe busting

What is Iframe Busting?

Iframe busting, also known as frame busting, is a technique used to prevent a web page from being embedded into another web page via an iframe. This technique is used to make sure that a user is visiting the true source page, rather than an intermediary page. In other words, it prevents malicious websites from hijacking a web page and redirecting visitors to their own page.

How Does Iframe Busting Work?

Iframe busting is implemented using JavaScript code. The code checks if the current window is in an iframe or not. If it is, the script will redirect the user to the original source page. This is done so that the user can be sure they are visiting the true source page, rather than an intermediary page.

Examples of Iframe Busting

Here are some examples of how iframe busting is used:

  • Preventing phishing attacks – by preventing malicious websites from hijacking a web page and redirecting visitors to their own page.
  • Preventing clickjacking – by preventing malicious websites from embedding a web page in an iframe and hijacking user clicks.
  • Preventing malicious ads – by preventing malicious websites from embedding ads in an iframe.

Conclusion

Iframe busting is a technique used to make sure that a user is visiting the true source page, rather than an intermediary page. It is used to prevent malicious websites from hijacking a web page and redirecting visitors to their own page. With this technique, webmasters can ensure that their visitors are not being tricked into visiting malicious sites.

References