English version: README.en.md.
使用 AI 自動分析並分組 Chrome 分頁的 MV3 擴充功能。支援 OpenRouter、OpenAI、Google Gemini 三家供應商,呼叫你選擇的模型(Claude、Gemini、GPT 等),僅依分頁標題、網域與最多 80 字元的網址路徑前綴把相關分頁放進同一個 Chrome 分頁群組;不讀取分頁內容,也不送出 query string 與 fragment。
chrome.storage.sync、任務快照僅儲存於 chrome.storage.local,皆不經過開發者伺服器tabIds 必須在白名單內、分組名非空、每組至少 2 個分頁npm install
npm run build
建置完成後會在 dist/ 產生擴充功能檔案。在 Chrome 開啟 chrome://extensions,開啟右上角「開發人員模式」,點「載入未封裝項目」並選擇 dist/。
npm run zip
會在專案根目錄產生 tabby-grouper.zip,可上傳至 Chrome Web Store 或分發。
chrome.storage.local,不會傳給 OpenRouter 或任何第三方。chrome.storage.local(不同步、不上傳);關掉開關會立刻停止記錄與摘要呼叫,本機既有資料保留。npm run dev # Vite dev 模式
npm run type-check # TypeScript 型別檢查
npm run test # Vitest 單元測試
npm run gen:icons # 從來源產生各尺寸圖示
技術棧:Vite + @crxjs/vite-plugin + 純 TypeScript,無框架。
src/
├── background.ts # Service worker:接收訊息、呼叫 API、建立群組、註冊 tabGroups 監聽器
├── lib/
│ ├── openrouter.ts # AI 供應商(OpenRouter / OpenAI / Gemini)呼叫與輸出驗證
│ ├── grouping.ts # 共用 helpers:pickColor、isGroupableTab
│ ├── tasks.ts # Task 型別、storage key 常數、保留期/容量上限
│ ├── storage.ts # chrome.storage.local 讀寫、CAS lock、lazy prune
│ ├── groupSync.ts # group↔task 對映重建、pendingResume 偵測、name/color 同步
│ ├── resume.ts # 任務恢復演算法
│ ├── messages.ts # background ↔ popup 訊息型別(discriminated union)
│ ├── *.test.ts # Vitest 單元測試
├── popup/ # 工具列 popup UI(分組 / 任務 兩個 view)
└── options/ # 設定頁(API Key、模型)
maxlength 擋下,即使繞過也會在 classifyTabs 入口 throwmax_tokens: 2048,避免模型輸出過長浪費 tokenisGroupResultShape 驗證 + validIds 白名單過濾,最壞情況僅為分組名稱被操控,不會執行任意程式碼或洩漏資料(API Key 僅存在於 HTTP header,不在 prompt 中)見 CHANGELOG.md。
見 PRIVACY.md。簡言之:
github.com/anthropics/courses/co…);query string 與 fragment(hash)一律去除、不會送出chrome.storage.local,不會上傳;封存超過 7 天自動清除,亦可手動刪除