jasonzissman / TimeMe.js

A JavaScript library to accurately time how long a user views a web page, disregarding idle time and time when the tab or window is minimized.
MIT License
592 stars 124 forks source link

Window event handlers #53

Open enmanuelr opened 5 years ago

enmanuelr commented 5 years ago

At several points the library adds focus and blur handlers to the window. However, there is no explicit unloading of these events.

Even after calling stopTimer or stopAllTimers events handlers are still registered and continued to fire. Because the event handlers are anonymous functions there is no explicit way to removing those specific handlers. Removing all handlers from the window could have unintended side effects on the client application.