Prevent parent window redirection from child

I have a site where I need to link to another site, this other site contains this code:

if (parent.window.opener) parent.window.opener.location='http://AdvertisingURL';
if (self.parent.frames.length!=0) self.parent.location=document.location;

The link on my site is a normal link with target = _blank, when I click on it, the site containing this code opens in new windows, and then my site is redirected to the advertising URL.

How to block a redirect without warning?

+3
source share

All Articles