0

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

azium
  • 20,056
  • 7
  • 57
  • 79

1 Answers1

-1

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..

Seth Malaki
  • 4,436
  • 23
  • 48
  • Really? I'm rewriting a socket.io chat application I made in Meteor. socket.io has an onDisconnect method that fires if someone closes the browser. There's nothing analogous in Meteor that isn't considered illegal? – azium Nov 24 '14 at 16:18