I'm trying to find a way to stop malicious ad IFrames from stealing top.location as they sometimes do (cheap traffic).
I used Atwood's HTTP 204 solution but in my tests seems like it breaks some basic functionality like manually changing the url via address bar and the refresh button busted as well.
I thought I might be able to stop the bubbling of onbeforeunload event and use the busting code inside "middle" IFrame but I couldn't make it, the onbeforeunload event in the "middle" IFrame fires and bust any redirection try.
I was wondering, is there any other way to keep the functionality as is and yet bust the redirection coming from a specific Iframe?