Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Catch window open event from iframe (jquery)

I have an iframe (not on the same domain) on my page. In this, there are intern-links and extern-links (with target blank). For the extern-links, I would apply a javascript function to transform the destination URL.

I would like to catch the window open event (or other event ?) which allows me to have the destination URL. I have tried with JQquery : click event on "a" object but it doesn't work (because iframe is not on same domain) and with a lot of others events... but nothing works !

Have you some ideas ?

For information, my javascript function rewrites the URL with Xiti parameters and does a window.open(newURL, '_blank')

like image 828
Aurélie Avatar asked Jun 15 '26 10:06

Aurélie


1 Answers

It seems like what you're trying to do is being blocked due to security restrictions. Have you considered adding your event handler into the page that's inside the iframe?

like image 77
alexg Avatar answered Jun 18 '26 00:06

alexg