Menu

How I built a tab manager in 136 KB with zero network calls
πŸ“°

How I built a tab manager in 136 KB with zero network calls

DEV Community: javascriptΒ·Tabs in OneΒ·about 23 hours ago
#Dy6TswoR
#devtojavascript#devto#dev#tabs#chrome
Reading 0:00
15s threshold

Chrome's native tab groups did not solve my problem. Neither did the memory saver. My problem was simpler and dumber: I keep forty tabs open because I am afraid of losing them, and forty tabs cost me about two gigabytes of RAM and all of my attention.

So I built an extension that does one thing: it takes every tab in the current window, writes the URLs into local storage, closes the tabs, and shows them back as one scrollable column. One click in, one click out. It is 136,138 bytes across 69 files, uses four permissions, and makes zero network requests.

This post is the engineering part: the ordering that keeps you from losing data, the normalization layer, the undocumented field I had to support, and the MV3 service-worker traps that cost me a weekend.

The constraint list

I set the budget before writing the code, because a tab manager that itself eats memory is a joke:

Constraint Value

Permissions tabs , storage , contextMenus , alarms

Network none, no host permissions, no remote code

Package 136 KB…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.