meteor/meteor — pull request #657 by Multiply (2013-02-01 12:40:14+00:00)
Title: Add support for checking if the app is reloading (migrating)

Currently I'm doing something similar to the code below, to check if Meteor is Migrating. The problem is, that this won't work for browsers not supporting sessionStorage.
```js
window.onbeforeunload = function() {
isReloading = window.sessionStorage ? sessionStorage.getItem('Meteor_Reload') : false;
if (!isReloading && Session.get('current_timer')) {
return "You've got active timers. Do you want to close the page, and leave them running in the background?";
}
}
```

With this pull request, I can now simply do something like the code below, and it should work for more than just browsers that support sessionStorage
```js
window.onbeforeunload = function() {
if (!Meteor._reload.isReloading() && Session.get('current_timer')) {
return "You've got active timers. Do you want to close the page, and leave them running in the background?";
}
}
```