Published at
Updated at
Reading time
This post is part of my Today I learned series in which I share all my web development learnings.

If you're a tab hoarder like me, you probably noticed that browsers discard inactive browser tabs to save resources eventually. The tabs are still open and visible in the browser UI but are put to sleep and only brought back and reloaded on tab focus.

Today I found out that there are ways to control if tabs should be discarded and even discard tabs yourself.

In Chrome/Edge navigate to about://discards (about is a shorthand to use the same protocol in Chrome and Edge and find all open tabs ready to be controlled.

Table showing all open tabs with options to discard tabs and control if they should be discardable at all

All tab entries include an Urgent Discard button to put them to sleep, and you can configure if a particular tab should be auto-discardable, too.

Similar functionality will be included in Firefox 94 at about:unloads. The page provides insights into the allocated tab resources and allows you to "unload" them one at a time. What's different here is that you can't decide which tabs to unload because the "unload" button only discards tabs in a prioritized order. 🤷‍♂️

Tab Unloading  Nightly has a feature that automatically unloads tabs to prevent the application from crashing due to insufficient memory when the system’s available memory is low. The next tab to be unloaded is chosen based on multiple attributes. This page shows how Nightly prioritizes tabs and which tab will be unloaded when tab unloading is triggered.  Existing tabs are displayed in the table below in the same order used by Nightly to choose the next tab to unload. Process IDs are displayed in bold when they are hosting the tab’s top frame, and in italic when the process is shared between different tabs. You can trigger tab unloading manually by clicking the Unload button below.

All in all, tab discarding is a handy functionality, and I'll try out discarding all tabs the next time I'm running low on memory or battery. (I can't lose all the tabs...)

But configuring "auto discard" for each tab, I won't mess with it. Browsers don't discard active tabs like a YouTube music video or the Slack UI, and they're probably smarter at figuring out when an active tab consumes too many resources than I am. 😉

Was this TIL post helpful?
Yes? Cool! You might want to check out Web Weekly for more quick learnings. The last edition went out 4 days ago.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles