Forum Moderators: open

Message Too Old, No Replies

frame breaker breaker? is there such a thing?

         

httpwebwitch

8:54 pm on Apr 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm loading a page in an iframe. it's someone else's site, and it's all legit.

but in that frame, they've got some JavaScript that redirects the page... and it's obviously using "top.window.location=..."; it takes over the entire page.

it's breaking out of my iframe!

I really want that stuff to stay in its iframe where I put it. I think breaking out and hijacking my page is actually pretty rude.

Is there a way to stymie their framebreaker? perhaps when they call "top.window.location", it loads inside my iframe? Can I define that iframe as the "top"? ha ha

I'd really like to stay with the iframe, not open a popup window, for reasons too banal to explain

whoisgregg

10:11 pm on Apr 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As far as I know, there is no way to interfere with the javascript running in a page loaded in a frame from a different domain.

Since it's legit, the easy thing to do is just ask the other site owner to remove their frame breaking code.

rocknbil

2:13 am on Apr 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think breaking out and hijacking my page is actually pretty rude.

Just as site owners think messing up their design by cramming their page into a frame on your site could be considered rude. :-)

If it's legit, they won't mind you asking. But no, short of disabling JS, don't think it can be done (Let the Javascript wars begin!)

However, what you could do, since I know you can server-side code, is use a cURL method to get the page and display that in your iFrame . . . but now you're scraping. <sigh>

httpwebwitch

4:05 am on Apr 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>the easy thing to do is just ask the other site owner

the other site owner is Mark Zuckerberg, the 23 year old billionaire. :)

Dabrowski

6:11 pm on Apr 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you use an onunload handler on your page to reload your page with his redirect?