Wordpress Plugin: Frame Buster
Posted by Moby on March 31st, 2005 at 7:09 pm
I’ve written my first Wordpress plugin. It’s called Frame Buster. This technique is also called a frame breaker or frame busting. It places some JavaScript in the heading of all pages that will prevent the page from appearing in someone else’s frame. This happened to one of my sites a couple of years ago and it was done to steal the site’s content. I did not like it. It should be noted that it will only work if the client browser has JavaScript enabled.
Version History:
- 0.20 Compatible with WP 2.0. It won’t bust out of the post preview frame. (2005-12-21)
- 0.10 Initial version
This is the code that it uses:
<script type="text/JavaScript"><!--
if (parent.frames.length > 0) top.location.replace(document.location); //–->
April 4th, 2005 at 7:47 am
[...] « Collaborazioni
Plugin WordPress: Frame Buster
Frame Buster aggiunge una manciata di codice JavaScript nell’intestazione [...]
February 12th, 2006 at 11:05 pm
[...] I upgraded the test server to the latest version of WordPress this morning. The only significant challenge I faced during the upgrade was caused by some frame busting javascript in my template. It took me a little while to find my way to the WordPress Support forums. Once I did, it didn’t take long to find threads from people with the same problem and the included solution. While I was looking around, I found a new thread buster plugin to replace my(?) old javascript, figured out how to finally get the sub-categories nested beneath the categories (from looking at the Blix theme) and figured out how to enable the calendar in the sidebar. The sub-categories fix was actually necessary, as the category list in my custom theme broke during the upgrade. The category list worked when I switched to the Blix theme, which also happens to have the nested category list that I’ve been wanting. [...]
December 23rd, 2006 at 10:18 am
[...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]
April 14th, 2007 at 5:23 am
[...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]
May 18th, 2007 at 9:04 pm
[...] Frame Buster: Este plugin lo uso como un sistema anti plagio, ya que impide que otra web externa a MSystems me ponga dentro de un Frame o Iframe. [...]
July 13th, 2007 at 10:43 pm
[...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]
June 13th, 2008 at 6:08 am
What if the frame is =0. I don’t know much coding, but if the length refers to width/height the script will not stop 0 size frames, right?
June 15th, 2008 at 5:50 pm
parent.frames.length is a count of the number of frames.