跳到正文
DEV Community· Suprabhat Das·· 3 小時前AI 評分41

Tab Hibernator Sloth:一鍵休眠分頁,節省 900MB

Tab Hibernator Sloth 🦥: Slow, Steady, and Saves 900MB in One Click

AI 導讀

Tab Hibernator Sloth 使用 Chrome 原生 discard API 休眠分頁,毋須關閉分頁;演示中休眠 20 個分頁可節省 900MB 記憶體。這款 727KB 的免費開源擴充功能在本機運作,毋須註冊,並可離線使用。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Tab Hibernator Sloth 🦥 - Save RAM Without Closing Tabs

Chrome eats RAM when you keep 30+ tabs open. Closing them loses context, shopping carts, and research.

Sloth doesn't close your tabs — it hibernates them. Tabs stay in your tab bar, turn faded, show as sleeping, use 0 RAM, and wake instantly when you click. One click to hibernate 25 tabs = ~1125MB saved.

Built for everyone with 20+ tabs open. So, everyone:

For developers: GitHub issues, Stack Overflow, localhost, docs - keep them all. Hibernate when you switch branches. 15 tabs = ~675MB back.

For researchers & students: 20 papers, Notion, Drive, Medium articles. Don't close, hibernate. Export as Markdown for weekly review.

For shoppers & planners: Amazon, Flipkart, Myntra carts you'll "buy later". Hibernate instead of buying now. Sloth rewards laziness.

For everyone with Gmail: That Gmail with 11,313 unread? Hibernate it. It still shows unread count, but uses 0 RAM until you need it.

Free • Open source • No sign-up • 727KB • 100% Local • No tracking • Works offline

Demo

Live Site: https://tab-hibernator-sloth.netlify.app/

Tab Hibernator Sloth Demo

Watch 20 tabs hibernate → save 900MB. Tabs stay in bar, RAM freed. Click any sleeping tab to wake it instantly.

Install in 15 seconds:

  1. Download .zip from the live site
  2. Go to chrome://extensions → Enable Developer mode
  3. Click Load unpacked → Select the unzipped folder
  4. Pin the sloth 🦥 icon

Works on Chrome, Brave, Edge, Arc.

Code

No GitHub repo — the entire extension is 8 files, 727KB, downloadable directly from the live site and fully auditable in 5 minutes.

Core logic (popup.js):

// List all tabs across all windows
const tabs = await chrome.tabs.query({});

// Hibernate = use Chrome's native discard API
// Same thing Chrome uses internally for Memory Saver
await chrome.tabs.discard(tabId); // 1 line = ~45MB saved

// Tabs stay in bar, faded, sleeping. Click to wake.

Extension structure:

manifest.json      // Manifest V3 - minimal permissions
popup.html         // 400px popup UI
popup.css          // No framework, pure CSS
popup.js           // ~4KB - all logic
icons/
  icon16.png
  icon48.png
  icon128.png
  icon512.png

Landing page: Pure static HTML/CSS, hosted on Netlify. No build step, no React, no API.

Permissions explained:

  • tabs - to list and discard your tabs
  • storage - to remember your last selection
  • - to read tab titles (local only)

✓ No network requests
✓ No analytics
✓ No cookies

How I Built It

I built Sloth around one Slow and Steady principle: use what the browser already gives you, don't add AI bloat.

Which open-source did I use? Chromium itself.

Instead of calling a closed LLM API to "predict which tabs to close" or "summarize your tabs with AI", I used Chromium's open-source discard API:

  • chrome.tabs.discard() - open-source, documented, local. It's the same API that powers chrome://discards. It unloads a tab from memory but keeps it in your tab bar. No data leaves your machine.
  • chrome.tabs.query({}) - lists tabs across all windows instantly. No cloud needed.
  • Vanilla JS + Manifest V3 - No React, no 5MB bundle, no build step. The whole popup logic is ~4KB. It opens instantly because there's nothing to download.
  • Local-first everything - All logic runs in popup.js. storage only remembers your last checkbox selection. You can open DevTools and verify zero network calls.
  • Open web for the demo - Landing page is static HTML/CSS, GIF was screen-recorded locally, deployed on Netlify. No closed video API.

This is Slow and Steady by design: instead of adding an LLM to decide which tabs you might need, Sloth trusts you and makes the lazy action (one-click hibernate) faster than the anxious action (Cmd+W x 30).

Why Does Open Innovation Matter?

A closed AI tab manager would send your tab titles and URLs to a cloud API for "smart grouping", require login, tracking, a dashboard, a "productivity score", break offline, cost money, and leak your Amazon carts and Gmail. It dies when the startup dies.

Open innovation made Sloth possible because:

  1. Chromium is open-source: I could read how chrome://discards actually works and use the same native API. No reverse-engineering a black box.

  2. Privacy by inspection: Anyone can download the zip from https://tab-hibernator-sloth.netlify.app/, unzip it, and open popup.js. 100 lines. Zero fetch(). That trust is impossible with a closed API that says "we don't store your data."

  3. No vendor lock-in: Works offline on a flight, in incognito, behind a corporate firewall. No API key to expire, no quota to hit.

  4. Remixable by anyone: MIT licensed. A student can fork it, add tab grouping, change the sloth to a cat, or make it auto-hibernate after 1 hour. The web gets better because the building blocks are open.

Slow and steady wins because open, boring tech (a 1-line discard call) beats flashy closed AI that needs your data to function.

The Lazy Payoff

I use it every day. Here's my actual week:

Monday: Had 32 tabs from weekend research. Selected 27, hibernated in one click. Saved ~1215MB. My MacBook fan finally stopped screaming. I kept all context for later.

Wednesday: Debugging with 12 localhost + 10 docs tabs. Hibernated docs while coding, woke them instantly when stuck. No more losing that perfect Stack Overflow answer because I closed it.

Friday cleanup: Exported 25 open tabs as a clean Markdown file for weekly review, hibernated 18. Zero guilt, all context preserved.

The math:

  • 20 tabs × ~45MB per tab = ~900MB saved instantly
  • 30 tabs × 5 seconds to carefully close = 150 seconds vs 1 click to hibernate = ~2 minutes saved per cleanup
  • No reloading lost form data, no re-finding URLs, no "where was that Amazon cart?" = priceless

The laziest part? I don't even decide anymore. By default, all non-active tabs are selected. I just click Hibernate. If I need it, I click the faded tab and it wakes instantly.

Being lazy is now the most efficient path. That's the Sloth way. 🦥

來源:DEV Community · dev.to