Actually the question is how to check that the parent window exists and redirect it to another site.

I have met more than once on the Internet when you go to Google, for example, click on a link in Google, a site opens in a new window or tab, and the Google page is redirected to some kind of third-party site



    2 answers 2

    Can open the site and run the Redirect script with a time delay ?

    Or run a script that will open a new window and redirect the current one? True, I do not know how well to do so. and did not fully understand what it was necessary to: redirect just opened or the one from which they left?

      If you are the owner of the site, and you can manage the code of the "parent window", then you can not complicate and do everything quite logical:

      <a target="_blank" href="ссылка для нового окна" id="xxx">текст ссылки</a> 

      Immediately upon clicking on the link, we translate the same window to the desired address:

       document.getElementById('xxx').onclick=function(){ window.location.href='нужная ссылка для родительского окна' } 

      If it is necessary to do it “from the inside”, from the child page, then almost certainly there will be problems with the “ same origin policy ”.