FreeMoby

My small doors.

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.30 Changed name to avoid confusion with another plugin. (2010-02-18)
  • 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); //–->

8 Responses to “WordPress Plugin: Frame Buster”

  1. WordPress Italy » Blog Archive » Plugin WordPress: Frame Buster Says:

    [...] « Collaborazioni

    Plugin WordPress: Frame Buster

    Frame Buster aggiunge una manciata di codice JavaScript nell’intestazione [...]

  2. The MacDeskBlog » WordPress upgraded Says:

    [...] 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. [...]

  3. Los Blog’s de la pagina de UiDoS » Plugins para WordPress Says:

    [...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]

  4. Profesor Blog » Los Mejores Plugins Para Worpress Says:

    [...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]

  5. Marlex Systems » Meme: Lista de Plugins usados por Marlex Systems Says:

    [...] 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. [...]

  6. » Enchula tu Blog,Plugins Para Worpress Información Tecnología Internet y Gadgets Says:

    [...] Frame Buster: Impide, mediante un pequeño código JavaScript, que la web sea mostrada en frames creados por otras páginas. [...]

  7. wattaman Says:

    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?

  8. Moby Says:

    parent.frames.length is a count of the number of frames.



Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>