W
W
web02020-05-03 18:54:42
JavaScript
web0, 2020-05-03 18:54:42

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

1 answer(s)
N
Nadim Zakirov, 2020-05-03
@zkrvndm

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 question

Ask a Question

731 491 924 answers to any question