On older browsers that don't support sendBeacon we can't block the unload and send the data, because we can't sent a timeout on that and on a slow network could prevent the tab from closing for some time.
We could however look for clues that they are about to close the window and flush the buffer then. These could include:
On older browsers that don't support
sendBeacon
we can't block the unload and send the data, because we can't sent a timeout on that and on a slow network could prevent the tab from closing for some time.We could however look for clues that they are about to close the window and flush the buffer then. These could include: