Framekiller - Framekiller Killers

Framekiller Killers

Simple framekillers can be prevented from working with the following JavaScript along with a server which responds with a HTTP/1.1 204 No Content, as discovered in this blog. Just place the following code in the top frame. It works because in most browsers a 204 HTTP response will do nothing, meaning it will leave us on the current page. But the request attempt will override the previous frame busting attempt, rendering it useless.

var prevent_bust = 0; // Event handler to catch execution of the busting script. window.onbeforeunload = function { prevent_bust++ }; // Continuously monitor whether busting script has fired. setInterval(function { if (prevent_bust > 0) { // Yes: it has fired. prevent_bust -= 2; // Avoid further action. // Get a 'No Content' status which keeps us on the same page. window.top.location = 'http://server-which-responds-with-204.example.com/'; } }, 1);

Read more about this topic:  Framekiller

Famous quotes containing the word killers:

    we want to remember when you were
    money in Massachusetts and yet were wild and rude
    and killers. We want our killers dressed in black
    like grease for we are sick of writing checks,
    putting on our socks and working in the little boxes
    we call the office.
    Anne Sexton (1928–1974)