82 comments

[ 3.0 ms ] story [ 164 ms ] thread
Chromebooks have long done this, but then they have a lot less memory.
https://github.com/richtr/NoSleep.js/

I wonder if something like this will get "extended" to work for desktop browsers now if this needs to become more popular?

I think something simple like looping an empty audio or video file will suffice. Not that I agree with that from a "hijack the user's browser without their consent" perspective. Just spitballing workarounds.

The firefox "Auto Tab Discard" I have is pretty aggressive in that it has a user selected list of conditions that allow an inactive tab to avoid being discarded (media playing/etc). So if the user hasn't explicitly allowed media playback to keep the tab from being discarded, if its in a background tab it gets discarded too.

Hence why I put a media player I want to run in the background in its own tab and whitelist it.

To be frank, this sounds like the feature I'd like to avoid most. I'd rather accept an OOM warning instead of dropping background tabs.

I don't even use that much tabs, around 30 at most, but this is the thing I use them for: to keep the current state.

I just wish they would get rid of tab groups, what a pain those are!
Why would you say that? For me it's one of the best Chrome features.
It's extra clicks when navigating between tabs.
Half of what I use tabs for are for fan-out on research.

I think the main problem here is the lack of user studies. I think if you watch a hundred people to see how they are using tabs, you'll find a couple of patterns and that the right solution is to do something else with the middle mouse click, such as creating a new reading list, or opening tabs but either not loading them at all, loading them at low priority, or reducing the priority by 15% for each successive tab you've opened from the current page.

If I open 6 tabs from google, I'm most likely going to click on the one that ends up next to my current tab. That one is the priority. Everything else is best effort.

Even easier. Give folks an option to turn this off.
There is an option to turn this off, both globally and on a site-by-site basis (if there's a page or site that you never want to be discarded, you can tell Chrome not to).
I use tabs a lot but at least in my case all this feature means is that the page refreshes when I go back to the tab, and for tabs I rarely access that's not a huge deal. Most sites where this would be an issue have session tokens anyways that automatically kick you off their page after a certain duration.
Time for a switch back to Firedox?
Firefox for everything but localhost on my machines. Chrome dev tools still win out.
Firefox is great.

However, an optional feature you can disable, and one that even prompts you to review the setting the first time you access a discarded tab, hardly seems like a good argument to do so.

Like, sure, go to Firefox for their stance of privacy and keeping a user in control. Don't go to Firefox because changing a setting is too difficult.

> Chrome has a reputation for gobbling up RAM, and Google seems to think the best way to combat that is to automatically shut down your tabs when they are "inactive."

Nothing like replacing a real problem with another potential problem.

(comment deleted)
I'm missing something... why is this an "all or nothing" deal? Like, can't you just leave people with their tabs and not store a shitload of data in memory?
WHAT? doesn't every developer have like 50+ tabs open?
It's just doing the thing Safari has done forever. Taking a snapshot of idle tabs and reloading on focus.
Does Safari freeze/reloads pages? As far as I can tell, at least to me it just slows down Javascript execution but keeps them open, to the point it messes up with some websites, like this: https://www.vitling.xyz/toys/acid-banger/ . I never "caught" it reloading pages like the old Chrome Sleeping Tabs extension did.

Or do you mean Safari for iOS? I'm thinking of macOS Safari here.

(comment deleted)
(comment deleted)
I assume this is rhetorical, but in case it's not: I don't think I've ever had more than 10-15 tabs open at a time, and even that is pretty rare for me. I generally have maybe five or six, and that's counting pinned tabs like Slack if I'm on my work computer or Spotify if I'm on my personal computer. I've never found it useful to have so many tabs that I'd need to use some sort of search functionality to actually find the one I'm looking for because I can already do that with my browser history without needing to make the half dozen tabs I'm actively using impossible to scan visually. I'm sure my preferred way of working seems as bizarre to some people as having dozens of tabs open at once does to me, but...that's exactly my point; no workflow, including having 50+ tabs open, is going to be universal.
Use the bookmarks, Luke.

Really, no, not every developer has 50+ tabs open. And it is very easy to avoid having them without losing anything if you want.

Life gets much simpler when you can just alternate between every active thing on your current desktop area.

bookmarks are vastly inferior to having the tabs open. state data can change when reloading it.

I have so many tabs, I have a second computer just for the tabs, which I keep running with all the tabs. For extra measures, they are bookmarked too, but I want them open so I can refer to them. It's like having a library.

I hear you. In 2016 I supported my tabs with a workstation with 32 GB of RAM. Then in 2020 I bumped that up to 64 GB.
Why do you keep reference material in your browser where it can change, be lost, is hard to find again and use a ton of ressources?

I think the most tab I ever had open at the same times was 10 when cross referencing something through a ton of tickets and a secondary system and that was already a pain.

> And it is very easy to avoid having them without losing anything if you want

It wouldn't be for me. I tend to keep hundreds of tabs open for various reasons. And when I reboot and Chrome screws up reloading my session, it's super frustrating. Do I _need_ those tabs open? No. Does having them open save me a 5-10 seconds a hundred times a day? Sure does.

During certain troubleshooting scenarios, I'll end up with a few dozen tabs open. The last one to be opened happens to be tied to the solution, and I realize there was never any reason to leave the previous 33 tabs open (except perhaps as a checklist of solutions I'd already eliminated...)
Why is it not feasible to store and later rebuild the page DOM and view state?

This is an annoyance across all browsers; there's no built-in way to bottle up the current state except by printing to PDF, which then becomes unclickable.

I spent time one summer playing around building a capturing system addon for Firefox which bottles a browser page DOM state, all assets, and necessary CSS styles inline into one single blob of HTML for long-term preservation. There were a lot of subtle gotchas to work out (which made for a stimulating exercise) but after some time it worked just fine, so it's 100% totally achievable.

I'd like to understand why this functionality isn't provided with every tier-1 browser.

Saving state is probably pretty involved once you factor in Javascript.
Given that they already have coroutine support... how hard could it really be? Honest question for people familiar with V8/complex JIT compilers .
Saving the VM state is not hard at all, the feature already exists (v8 snapshot) and is used in Chrome and Node.js to initialize the JS standard library.

The problem is native handles. The DOM is easy to restore, but how do you restore a WebSocket connection? An IndexedDB transaction? A `Blob`, a stream, or a WebAssembly module that JavaScript assumes to be initiated?

There are solutions to each one of these, but there are still a lot of remaining pieces that are stateful and not easy to restore or gracefully close. It's possible, but it requires a lot of work.

I could be mistaken but I don’t believe that v8 snapshots support saving the vm in an arbitrary state. The snapshot is created after the script is compiled and that’s about all you can use to restore (it’s for speeding up loading the JS only).
If you actually want to save the rendered HTML of a page you can use the SingleFile Firefox addon: https://addons.mozilla.org/en-US/firefox/addon/single-file/

I think it's available for Chrome as well.

It is able to embed images in the file as well as data urls.

Edit: I use this to capture social media web pages that I have contributed to so that I have a copy in case they get deleted.

> Why is it not feasible to store and later rebuild the page DOM and view state?

It is. It's called swap. They should just throttle the JS down to zero, and then let the OS deal with the memory. Each tab is a separate process. What they need is the opposite of mlock, a way to tell the OS to pretty please swap out this process's memory because it is unlikely to be used in the foreseeable future.

a while back on hn there was talk of an archive project or webscraper that "got it right"[sic] It didn't rewrite the html but served files by the original path. It sounds like the right approach.

Maybe someone remembers what it was called?

> Why is it not feasible to store and later rebuild the page DOM and view state?

For the purposes of saving memory, which is what tab discarding is intended for, where should it be stored?

* In RAM? It is already there and that is the problem. Maybe you could compress it when inactive, but that won't be effective for pages with much image or other media data.

* To disk? At that point you might as well leave it in RAM but inactive and let the OS page it out as needed. Maybe marking it as inactive internally (so your own garbage collection sweeps don't make the OS think the data is active) and to the OS (assuming there is a concept of this-is-low-priority-so-page-it-out-before-other-stuff at that level).

For storage, save-entire-page-to-disk which has existed in most browsers since early versions does most of the job well enough, with opening the stored result in the same browser being the rehydration method, that it might not be worth creating and maintaining something more complex for the remaining part of the job to cover all the cases that this doesn't. Though the balance may have changed, as even simple pages are often effectively SPAs these days there may be more edge cases that “save all” doesn't work with then cases where it is fine.

> I'd like to understand why this functionality isn't provided with every tier-1 browser.

Lack of demand. While it would be very useful for a minority of users, there aren't enough of them for the feature to affect market share, so the big browsers aren't going to bother. It is the sort of thing niche browsers/add-ons might have more interest in.

Every implementation I have ever seen of this concept has correctly avoided dropping tabs with dirty state in text boxes, so I think this article is freaking out and causing panic in these comments about a scenario that almost certainly will never happen. Also: I bet you'll be able to turn it off. But, as someone who actively uses a billion tabs and also cares deeply about state, I have 1) always used various versions of this feature when available in browsers or via extensions and 2) I don't think I have ever seen one lose state I cared about. The real hilarity to me is merely how Google has taken so long to enable this use case by default in the core, and I will claim it is due to their anti-user pro-surveillance business models that enjoy having code sitting around running occasionally in a number of what should have long since become static renderings of pages I have open.
I've been caught by this on mobile Firefox lots of times. And Chrome isn't known for letting users opt-out of decisions they've made (based on their great telemetry no doubt).
Under the bold heading "How to turn it off" with a large picture of the ui telling you how to turn it off has this

> The consumer controls for Memory Saver live at 'chrome://settings/performance,' or, for the UI-inclined, hit the menu, then "More tools," then "Performance." You can turn off the feature entirely or add sites to a list called "always keep these sites active."

so it seems like turning it off is in the cards for this feature

That's good. I'll bet you a WinZip license that the option to turn it off has been sunsut within two years though.
> Every implementation I have ever seen of this concept has correctly avoided dropping tabs with dirty state in text boxes

Have you used iOS Safari? I use it because of private relay and extensions (I’ve written a few for myself that “clean up” websites I frequent). However, the dropping is atrocious. Because my phone is 4 years old it can barely keep 1 tab in memory. Sometimes the tab is even dropped even if I simply lock my phone and come back to it a few hours later without even opening any other apps. All state is lost. Worse, as I exclusively use private mode, when the tab is dropped the cookies are dropped too. So I can’t even stay logged in to anything. It’s a terrible experience.

My phone is a 4 year old iPhone SE and I’m writing on it now in private mode. I honestly don’t have the same experience as you, it mostly works fine.
Yeah there could be something else going on. Apps constantly reload too; the other day I had an app open, locked the phone, unlocked it 5 minutes later and the app completely reloaded. This happens all the time with loads of different apps. The battery health is quite low so maybe it gets more aggressive in killing things off? We'll probably never know.
My experience matches shortcake27's. For instance, I've had a recipe loaded up in a tab, gone off to mix ingredients, and unlocked the iPhone for the next step only to see the page reload.
Oh, yeah. That one sucks. But I didn't actually consider it to be in the same category of feature as Apple throws away entire processes and doesn't seem to give a shit, and that's kind of the underlying defense of losing your tab state, as far as I can tell. I meant on desktop browsers.
perhaps disable background app refresh except for a few apps.

It’s a huge battery drain, and might allow some apps to eat away your memory during the update/refresh

Tab dropping is one of the main reasons that iOS safari is horrible for proper work.

Seems that we are going backwards

Yeah: I do agree with this. I meant the way the feature has been integrated into desktop browsers (or cobbled together with extensions). The lack of regard companies have for the now vast majority of users who either primarily or even only use "mobile" devices is ridiculous.
Oh no, what a surprise, Ars Technica again writing a Google article that's sensationalist and written in a misleadingly critical way? Must be Wednesday.

Seriously, they've been grinding this axe and writing sensationalist misleading articles for years now when it comes to Google (and outright downplaying Apple issues as well).

Generally Speaking, there are lots of Apple Fans around the world, high value in ads and don’t click anything that criticise Apple. On the other hand there are lots of Google Haters. Basically it is just the press pondering to their reader’s prejudice.
Yeah, it's a bit annoying because I've respected Ars quite a bit until they got really blatantly biased and untrustworthy. :/
Ron Amadeo who writes on Google and is the Ars Reviews editor has always had some peculiar conceptions about what’s acceptable behaviour for a piece of software and what a smartphone should be. I mean for a long time he was famous for obsessing about phones bezels size. I think what you notice has more to do with his opinions showing through the writing than a conscious editorial choice favouring Apple from Ars.
Probably be able to turn it off up to a few months then its hidden behind a cli flag. Lots of options that were once in chrome://flags were removed making it impossible for any normal user to customise the browser how they want.
This is a symptom of multi-process browser auto-immune disease.
Ah yes, the thing I hate most about mobile browsers is now coming to my desktop browsing experience.
If they’re trying to reduce Chrome’s memory footprint, why not page/swap out inactive tab states to the filesystem instead of deleting? This feature is going to cause a lot of unexpected data loss.
- It won't discard background tabs with: Active Audio/Video, Screen Share, Page Notification, Active Downloads, partially filled forms, or connected devices.

- It can be disabled via chrome://settings/performance

- Installing browser updates, like 110, may lose tab state anyway.

The only potential "sin" they made here is enabled by default.

However, users also dislike being prompted with new choices when an update installs. They want updates to be "invisible."

It also seems like the first time it discards a background tab, it does warn you that this can be turned off in Settings, which is maybe a fair middle ground.

I got that popup after it put a background page into low-mem state. It told me that it had done it and that I can disable it. I think it gave me a link to the settings location.

Most of the people who don't care about browsers will be accustomed to having their state erased anyway when something like a page-reload or a navigation-action has been made, so I think it's fair to enable it by default. The benefit they get by it outweighs the side-effects, specially if you consider your first point.

> It won't discard background tabs with … Active Audio/Video … partially filled forms …

Thus begins a new arms race, as people who don't want their tabs discarded add hidden forms which are later modified by JS to look like they have useful new state, or adding silent single-pixel auto-playing videos, and the browser try to detect those tricks, so further tricks are devised.

HN has way too much of a hate boner for enabled by default. If things didn't have any features enabled by default, 95% of people would never know they existed. Hell, why have the ability to have multiple tabs enabled by default?

For invasive things like data collection, sure. For what amounts to garbage collection, does it really matter?

Will this tend to increase ad impressions, with some ad systems?
I always have to end up getting some kind of extension to circumvent this behavior. Just make it an easy option and stop trying to know whats best for users, please.
I don’t understand people who use a gazillion tabs. How do you do it? How do you find what tab is which? Isn’t it as hard to find the tab as it is to actually find the page, when you need it again?

I honestly don’t get it, but it intrigues me.

Not a gazillion tabs but about:telemetry#scalars-tab_search=tab tells me that I have 102 open tabs in Firefox.

I have five virtual desktops, two for me and three for my current three customers. One Firefox window per desktop. The windows in the three customers' desktops have the tabs to the web apps (prod, preprod, dev) I'm working on plus documentation sites, CI, cards, administration sites, etc. That's 10 to 20 tabs per customer. Some of them are pinned. The two windows in mine desktops have some pinned tabs and some stuff that keeps there maybe for a long time until I finally close it. Not a big deal, but 102 tabs in one window would be challenging. I bet somebody has 1,000 of them in one window and will write that it's not a big deal too :-)

I have had close to 1000 but not in one window. I have several clients who regularly ask me to do random things that necessitate a lot of tabs, so that all adds up. A lot of times it is unclear when that project or task is actually "done" (I wait on feedback or requests further work) so they accumulate. I eventually got smart and put the tabs for one project/task in a new window. Then I can just close the window to get rid of those tabs.

Then I also have the problem of finding links relating to my personal computing interests, so those build up also until I read them in my free time or reorganize them.

To answer the original question, tab search is entirely necessary.

Finding the tab is easier due to "spatial" memory Also, tabs are co-located in related "sessions", that helps as well Also, you can easily not know the website, that's just one of 5 results you opened from google on this topic

And with vertical tab list you're not limited to just the icon, but can scroll& read

The bookmarks lack the convenience and immediacy of this even though you can save groups of tabs there as well, but then access is slower/less convenient

Will this cause the Teams notifications to be delayed even further than they already are?
Been using The Great Suspender / The Marvelous Suspender for years on Chrome. I feel like it maintains state when reloading a tab but I could be wrong.
Well, everyone I know uses tabs as bookmarks anyway. Because Chrome "improved" the concept of bookmarks to the point where they're barely usable. Thanks, UX designers! And fuck you.
About time, though was hoping the native solution would be smarter than existing extensions and more advanced into trying to avoid data loss and instead of completely discarding a tab would save some state
More and more user hostile moves. Whether to close a tab, it never a decision for the browser to make.