K
K
Kyber_Ded2021-06-07 16:36:42
JavaScript
Kyber_Ded, 2021-06-07 16:36:42

How to track the event of closing a tab, and not switching to another one?

There are 2 tabs of one site. It is necessary when closing one tab to transfer data to the second. I'm using the onbeforeunload event . But the problem is that if I just switch to another tab instead of closing it, onbeforeunload still fires.
How to track exactly the closing of the tab, I can not think of.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ao, 2021-06-07
@darknefrit

How to correctly track the tab close event?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question