4 ms·
I hear you guys. Just trying to avoid the situation where you type something, then close the tab shortly thereafter and lose what you typed.
by awt 16y ago
I hear you guys. Just trying to avoid the situation where you type something, then close the tab shortly thereafter and lose what you typed.
- mechanical_fish 16y agoI said to myself "man, isn't there a way to catch the tab close event in JS"? And, lo, Google provides: http://stackoverflow.com/questions/138411/catching-a-tab-close-event-in-web-browser http://stackoverflow.com/questions/138411/catching-a-tab-clo... Mind you, I'm not the one who is going to have to debug this stupid idea cross-browser, so please forgive the suggestion if it turns out to be stupid. ;)
- troutwine 16y agoAnd a Jquery specific question/answer, as I note that our friend is using that library: http://stackoverflow.com/questions/1631959/browser-window-close-event http://stackoverflow.com/questions/1631959/browser-window-cl...
- awt 16y agoI believe that onbeforeunload always prompts the user with a popup, which may be why I left it out -- can't quite remember. I will re-evaluate that decision.
- troutwine 16y agoBeing able to set the timeout would be a nice feature. Really I would be annoyed with 15 seconds, though I do agree that such a timeout is more suitable than is 1 second. I keep my hard-drive spun down for a simple reason: power consumption. I suppose I could dig around and find out why Chromium is being forced to sync against my explicit fstab timeout, but that's rather too much effort. Besides, electronic data is impermanent; I must either trust that my browser maintains the local storage correctly or that you do on your end. The matter of convenience of such an electronic journal--say over my Moleskine or org-mode setup--is that I am spared a bit of setup cost. In turn I trade a bit of peace-of-mind with regard to my data. Not, of course, to besmirch your efforts.