Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer. --Fred Brooks, Jr.

How Do I Keep My Website From Being Viewed In a Frame?

Using Javascript to escape frames

Summary

Certain websites, such as search engines or email providers, will forward to new web pages inside a frame so they can continue to show their own banner at the top of the page. This, in my humble opinion, is bad form--similar to popups.

You can actually force a browser to load your page and drop the frame using a little bit of javascript. Once again, I don't recommend this because it's generally a bad idea to mess with a person's browser (maybe they like the frame), but I have had occassion to use it when the frames caused problems for web page.

Example: How to escape a frame and load your page in the browser
<HTML> 
   <HEAD>   
      <SCRIPT language="javascript">
      <!--
         if (top != self) 
            top.location = location;
      //-->
      </SCRIPT>
   </HEAD>
   <BODY>
      Test page.
   </BODY>
</HTML>
 

Version: 6.0.20200920.1535