<One sentence: what the extension does.>
Stack
-
Chrome Extension Manifest V3, TypeScript, bundled with <Vite + CRXJS WXT Plasmo esbuild> - Parts: service worker (
background), content scripts, popup, options page
Commands
- Dev build (watch):
npm run dev; loaddist/via chrome://extensions > Developer mode > Load unpacked - Build:
npm run build - Tests:
npx vitest run - Package:
npm run zip
Rules
- Manifest V3 only: the background is a service worker. It can be stopped at any time, so keep no state in globals; use
chrome.storageand alarms instead of timers. - Request the minimum permissions and host permissions; prefer
activeTaband optional permissions. Every new permission needs a reason in the PR. - No remotely hosted code: everything executed must be in the package (no
eval, no loading scripts from a CDN). - Content scripts run in an isolated world; communicate via
chrome.runtime.sendMessagewith typed message shapes, and validate messages from web pages. - Never inject untrusted strings as HTML; use
textContentor a sanitizer. - Test in a fresh profile; check behavior after the service worker restarts.
Definition of done
- Build passes, tests pass, extension loads unpacked without errors in chrome://extensions, permissions unchanged or justified.