buster.js

buster.js is a frame-buster-buster script (requires jQuery 1.6+).

A frame-buster-buster busts frame-busters. In other words, some sites (vimeo.com is a good example) include scripts to keep their pages from being displayed in frames – instead they pop out of the frame and take window focus. This is for good reasons, mostly to protect intellectual property and be sure their content is represented as their own, not as someone else’s.

buster.js is intended to bust these scripts, or prevent them from popping out of the frame. To be clear, this is not intended to be used to misrepresent the owner of any content. This is intended for use on sites/pages where you want to take the user to an external site for some reason, but want to keep a bar at the top to bring them back to your site once they’re finished (or something to that effect).

buster.js is provided as a free script and I take no responsibility for how it is used outside of my control.

On to the good stuff!

Usage

For use with a single frame, simply call buster.wait and pass the unique ID of the frame where you want to prevent busting:

<iframe src="http://vimeo.com/39408892" id="thisFrame"></iframe>
<script>
    $(function(){
        buster.wait("#thisFrame");
    });
</script>

For use with any frame on the page, call buster.wait(“iframe”), which will watch every iframe on the page. Please note the performance and reliability of this may be finicky:

<script>
    $(function(){
        buster.wait("iframe");
    });
</script>

Finally, if you want to integrate busterjs into your own app, you can simply call buster.on and buster.off as you see fit:

buster.on();
buster.off();

Download

buster.js is available on github at the following URL: https://github.com/spoontwisted/busterjs

§ One Response to buster.js

Leave a Reply

Your email address will not be published. Required fields are marked *

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