Break Out of Web Proxy Frames

Aim
To break out of Web Proxy Frames or any frames for that matter all you have to do is add the javascript shown below to your web page and replace the codediaries.com/break.html link with your own link. Web Proxies can sometimes be a nuisance to webmasters as these proxies sometimes stop adds and mangle content. With this code snippet, you can easily break out of 98% of Web Proxies, provided they have javascript turned on. Let's bust all those web proxies!

 1. <script>
 2. if (top.location!=("http://codediaries.com/break.html")) {
 3.             top.location = "http://codediaries.com/break.html";
 4. }
 5. </script>
Hide line numbers

To see this in action visit the link http://codediaries.com/break.html using a web proxy.

Unfortunately Web Proxies are a little smarter than your average Frame and they tend to rewrite and insert a lot of javascript code. You get around this by obfuscating the javascript code using any online obfuscater. Once done, the code will look like this.

 1. <script>
 2. var _0x5135=["\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x68\x74\x74\x70\x3A\x2F\x2F\x63\x6F\x64\x65\x64\x69\x61\x72\x69\x65\x73\x2E\x63\x6F\x6D\x2F\x62\x72\x65\x61\x6B\x2E\x68\x74\x6D\x6C"];if(top[_0x5135[0]]!=(_0x5135[1])){top[_0x5135[0]]=_0x5135[1];} ;
 3. </script>
Hide line numbers

Javascript obfuscators are readily available and most of them are online. Just search for "javascript obfuscator" in your favourite search engine.

Once you learn this simple trick you can now make changes and experiment on breaking these Web Proxies and Frames. Use this as a starting point for your web proxy demolition.