holidayextras / barometer

Framework agnostic browser performance metrics
MIT License
5 stars 5 forks source link

Flush buffer on unload clue #5

Closed msaspence closed 7 years ago

msaspence commented 7 years ago

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:

theninj4 commented 7 years ago

Moving the mouse of the window is already implemented, however watching for key presses is a neat idea. :+1: