0

Referring to question here

The anti frame busting js code works well on Chrome, but it's not working on either Firefox or IE. I think this may be due to the fact that the site I am trying to iframe puts the frame busting code on the top of the page.

I am trying and researching to find a way to get around this and here's what I've come with:

window.onbeforeunload = function() {

window.onbeforeunload = null

return "CLICK STAY ON THIS PAGE OF YOU SEE THIS BOX"

}

Basically this ask the user to click stay on this page and it worked but I am trying to find any better way that doesn't need user interaction.

This is not for an evil purpose so try to help with it.

Community
  • 1
  • 1
  • 2
    "this not an evil purpose" that sounds like something an evil person would say. – Niet the Dark Absol Dec 29 '14 at 00:17
  • @NiettheDarkAbsol if you are not going to help then no problem sure someone will have suggestion – sherif halim Dec 29 '14 at 00:23
  • Maybe @NiettheDarkAbsol means 'sarcastically' that you need to explain your situation more specifically to us. What are you coding and why do you need to put a website that doesn't want to be in an iframe in an iframe? – Mouser Dec 29 '14 at 00:30
  • @Mouser it's one of my clients who need to iframe certain website in their page – sherif halim Dec 29 '14 at 00:36
  • We normally see this behaviour on `certain` websites with pornography and illegal download poping up advertisements which ask the user to stay on the page when they try to close it. So be more specific before we help malicious coders. – Mouser Dec 29 '14 at 00:39
  • @Mouser the client need to iframe this site"gofirstrow. eu" on his page and this site has frame breaker code on the top of the page we need to get around this on FF and ie – sherif halim Dec 29 '14 at 00:54
  • possible duplicate of [How to prevent IFRAME from redirecting top-level window](http://stackoverflow.com/questions/369498/how-to-prevent-iframe-from-redirecting-top-level-window) – Kaiido Dec 29 '14 at 01:46
  • Why don't you ask the site you are trying to frame to add an exception? If they aren't willing to do that, even if you prevent this frame busting code, they may add better frame-busting code that can't be broken. Forcing a website that doesn't want to be framed into a frame doesn't seem very ethical. – Alexander O'Mara Dec 29 '14 at 01:53

0 Answers0