0

In my website, I preview any link with a tooltip, but when its facebook or meneame.net, for example; they block it and open their webiste in you website's current window.

Exanple <iframe src="http://meneame.net/bababa"></iframe>

How can i prevent that? i mean, maybe open it in a '_blank' page instead would be perfect for me. is it possible?

PD: the option of trying to detect which URL is about to be opened its not valid for me as long I don't know all the websites that do so.

Kara
  • 6,115
  • 16
  • 50
  • 57
Toni Michel Caubet
  • 19,333
  • 56
  • 202
  • 378

1 Answers1

1

This problem is due to the "same origin policy". It was design specifically to prevent wrapping pages from hijacking iframe content. It's a security feature. If we could circumvent this all browsers will then be insecure.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
  • The thing is that i don't want to show it in my page if 'they' don't 'want' but i just want to detect that and be able to abort instead of bein redirected. Do you think that is posible? – Toni Michel Caubet Mar 24 '11 at 20:02
  • Look at this question: http://stackoverflow.com/questions/369498/how-to-prevent-iframe-from-redirecting-top-level-window – Jamie Treworgy Mar 24 '11 at 20:04
  • I had a very interesting reading and realised that if user wants to come back they only have to 'back' and if not, where is the point. Thanks a lot! – Toni Michel Caubet Mar 24 '11 at 22:27