How do I handle disconnected user in meteor / iron:router

83 views Asked by At

Iron Router has this awesome method onStop which lets me write code for when a user navigates away from a page. How can write that same code when someone disconnects, like closing the browser, for instance. Thanks

1

There are 1 answers

1
Seth Malaki On

You can only track tab events because the window Javascript API makes this possible.. for tracking the whole browser's close method it would be very intrusive to do so and safe to say that you'll never track it effectively unless you resort to highly intrusive (mostly illegal) methods. One legal way is to convince the user to install a browser extension just for that..