Answer the question
In order to leave comments, you need to log in
How to make JS execute only when there is an open site?
There is a site A with a script , and site B (this is google.com)
We need the script on site A to be executed ONLY IF site B is OPEN .
If the user has closed site B, the script stops running. Opened site B again - the script on site A continues to work.
Give me a direction, I'll figure it out on my own. Thanks everyone
Answer the question
In order to leave comments, you need to log in
If the second site opened the first one, then you can track its status from the first site.
See the site property below.
site = window.open('https://google.com');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question