Skip to content

TabTTL's adaptive lifetimes in one percentile, one margin and one rule that keeps learning from ever making things worse.

JP 2 min read

A five-minute tab lifetime is perfect for a search result and terrible for the docs page you check every twenty minutes. Nobody wants to write a rule for every site, so TabTTL learns the lifetimes itself, on the device, with a deliberately boring algorithm.

Record one thing

For each site, TabTTL records how long you were away from a tab before you came back to it. It stores the registrable domain (github.com, whether it was www. or gist.), a duration and a timestamp. The URL, title and content of the page are never stored.

What gets recorded depends on how you come back:

You… Recorded
come back while it's counting down time away, minus paused time
reopen it after it expired twice its lifetime: it clearly needed more
flip back within 10 seconds nothing: that's tab-hopping, not returning
use a private window nothing, ever

Turn it into a lifetime

Keep the last 20 observations from the last 30 days. Once there are at least three:

  1. Take the 75th percentile: the time within which you came back in three of four cases.
  2. Add a 25 % margin, so coming back a little later than usual still works.
  3. Round up to whole minutes and cap the result at four hours.

Example: you came back to github.com after 8, 12, 20 and 4 minutes. Sorted: 4, 8, 12, 20. The 75th percentile is 12; plus 25 % is 15 minutes.

The rule that makes it safe

Learning can only make a lifetime longer. If the learned value is shorter than your default, TabTTL ignores it. So the worst a bad estimate can do is keep a tab around a bit longer, which is exactly what TabTTL did before it learned anything.

Explicit choices still win: a lifetime set for one tab beats a site rule, which beats the learned value, which beats the default. The popup always says which one applies ("18m · learned") and why.

Why not something smarter?

I went with a percentile because it can be explained in one sentence, and that matters when software closes things for you. The settings page shows exactly what was learned, per site, with a button to forget it. You can't do that honestly with a model you can't explain.

#browser-extensions#product#privacy

About the project

Expired 3
J by-jp.de
D D Docs: Alarms API
G G Pull request #42
F F Flight deals
R R Recipe: ramen
Live

TabTTL

Auto-close tabs you stopped using, in Firefox and Edge.

A Firefox and Edge extension that groups, closes or unloads tabs you haven’t used for a while. Each tab counts down on its icon; sites you revisit get more time.

View project →

Keep reading