8 ms·
The main reason tabs aren't saved to disk isn't a concern about responsiveness, it is a concern about data loss. You have to be very sure that you restore the s
by mccr8 10y ago
The main reason tabs aren't saved to disk isn't a concern about responsiveness, it is a concern about data loss. You have to be very sure that you restore the state exactly. What if you spent a few hours filling out some government form online, then you went and took a break by watching a few YouTube videos? Memory usage might spike up, and the browser decides to unload the tab with the form. You'd be mad if form state got lost when you switched back.
I've heard that some people set Firefox to not autorestore tabs on load, and then periodically close and reopen Firefox, so their background tabs aren't loaded. Pretty clumsy, but I guess it gets the job done. I don't know if there's any addons that do something similar.
- alyandon 10y agoIf the feature existed and it didn't properly restore form content when I switched back to the tab then I'd call that a bug. :-D
- sp332 10y agoThis is the default. If you set it to restore from your previous session on startup (or if it restores your session after a crash, or you choose History->Restore Previous Session), then it will only load tabs when you switch to them.
- MichaelGG 10y agoFF mobile does this and it drives me nuts. I'll be on 4chan, watch a YT clip, then tab back and FF reloads the original HTML. Apart from being slow (takes a few seconds to rerender it all), it also loses AJAX-loaded data. My phone reports it has 600MB of RAM free, so I dunno what's causing FF's behaviour here nor how to disable it. I can't always reproduce it, but it happens enough that every browsing session has some sort of frustration.
- dTal 10y agoAll the mobile browsers I've tried do this - Firefox, Dolphin, and stock Android. I distinctly remember browsing the web quite happily with Firefox desktop on a machine with 512 MB of RAM as recently as 2008, so I can't help but feel we've gone backwards.
- derefr 10y agoAm I the only one who loves this behavior? I'd be perfectly happy forcing Chrome/Firefox/etc. into a 1GB sandbox and then telling it to "unload tabs on memory pressure." I only use a few tabs at a time; a simple LRU OOM-eviction algorithm should work wonders.
- brokenmachine 10y agoMaybe you're the only one. I hate waiting for a tab to reload from the network unnecessarily, especially on mobile!
- derefr 10y ago"From the network" isn't actually a part of the semantics of this behavior, though. If the page's browser-side cache is still valid according to its original response headers, the browser will just reload the page from cache rather than hitting the network.
- amenod 10y agoAndroid or iOS? I have no such complaint on Android - I usually load the pages that interest me in separate tabs and then read them offline.
- MichaelGG 10y agoAndroid. I can do that, but when I return to those tabs, they will reload from a cached version.
- reitanqild 10y ago>> by being able to mark tabs as "no background activity allowed" > What if you spent a few hours filling out some government form online, then you went and took a break by watching a few YouTube videos? Memory usage might spike up, and the browser decides to unload the tab with the form. You'd be mad if form state got lost when you switched back. GP is talking about actively marking tabs as "no background activity allowed". I have been searching in vain for something like that: stop scripts in background tabs except for specifically whitelisted pages. There is absolutely no reason that I can see why every website and their ads should be allowed to roam around freely in the background. There is however a number of reason why they should not be allowed. Battery life and phishing attempts readily comes to mind. I guess whoever comes up with a well-working extension for that can easily ask me for USD 30 or even 40 and expect me to be a walking billboard for it ;-)
- mccr8 10y agoBackground tabs already have their timers run less frequently. In Firefox, that was added in 2011 [1]. Certainly further improvements to reduce background tab activity would be nice. One way you can sort of get that effect is to use Reader Mode, on pages where that works. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=633421 https://bugzilla.mozilla.org/show_bug.cgi?id=633421
- yoasif_ 10y ago> I have been searching in vain for something like that: stop scripts in background tabs except for specifically whitelisted pages. Have you tried UnloadTab? https://addons.mozilla.org/en-US/firefox/addon/unloadtab/ https://addons.mozilla.org/en-US/firefox/addon/unloadtab/
- reitanqild 10y agoOk. Will try. I think I see an issue here where I want to go back to a tab I have open on the train home. If it is unloaded that means I have to connect to the Internet again to get hold of my page again? (I'd think what I want is just to pause any javascript or other processing from any webpage that us not focused in the browser and not specifically whitelisted.)
- derefr 10y agoHow about detecting the pages that don't have stateful elements, and then only serializing those?
- srean 10y agoWith applications written in javascript ? Stateful on the client side alone or stateful on both sides ? It wont be safe to assume that state is persisted transparently on the server side. May be they just cache it for a while. To make this work reliably would be quite difficult.
- derefr 10y agoYou could be really conservative: only assume statelessness if the page has no <form> elements and has no calls to the XMLHTTPRequest API (or window.eval). Or you could be really conservative: only assume statelessness for pages without forms and without any Javascript. (These do exist!)
- srean 10y ago> These do exist We have seen things people wouldn't believe. Webpages without any Javascript. Webpages using correct http responses. Watched C-beams glitter in the dark near the Tannhauser Gate. All those moments will be lost in time, here come the transpilers