Hmm, right, sorry. 

However, I'm not sure if it'd worth to add another try-catch anyway – people might be saving/loading state by themselves. 

All this DOM/window/event stuff gets pretty messy now … maybe this can be refactored to be more environment agnostic. I'll have a look at it … or do you have any ideas?