DEV Community

Discussion on: Make a Secure Browser?

Collapse
 
rsa profile image
Ranieri Althoff

See, a web page being able to even know if they are looking or not is a violation of privacy.

The best you can do is adding a listener to the beforeunload event, which will trigger before the user tries to close the tab, and one to the mouseout event for the document, which will trigger when the mouse leaves the viewport. However, both of those can be disabled/blocked by the user.