Anti-Frame Script
Stop unauthorized embedding. This script checks if your page is currently trapped inside a frame. If it is, it automatically redirects the browser to load your page as the main window.
Copy the Script
<script>
// Anti-Frame Logic
if (top.location != self.location) {
top.location = self.location.href;
}
</script>
Frequently Asked Questions
Malicious sites may use hidden iframes (Clickjacking) to trick users into clicking buttons on your site without realizing it. Others might frame your content to steal your traffic/branding.
Yes, this is a standard JavaScript check. However, modern browsers also support the 'X-Frame-Options' HTTP header, which is a more robust server-side solution.
Yes. If you use frames/iframes on your own website layout, do not use this script. It will cause your site to constantly reload.