3 ms·
I just tried it (Chrome on Mac), and beforeunload is not called when I lock the machine. The MDN docs also don't suggest that it should be.
by paulgb 3y ago
I just tried it (Chrome on Mac), and beforeunload is not called when I lock the machine. The MDN docs also don't suggest that it should be.
- maxloh 3y agoFor the "invalidate session on screen lock" feature, it is possible to create close enough workarounds in today's JavaScript. https://stackoverflow.com/questions/15959244/ https://stackoverflow.com/questions/15959244/ Bottom line, you can simply listen to mouse move events and invalidate the current session on user inactivity.