This repo is best worked on as a browser-extension project with deterministic local fixtures. The fastest way to make good changes is to keep a Gym page, a focused test, and a small code change aligned.
- Node.js 20.18.1+ recommended
- Chrome or Chromium for MV3 testing
npm install
npm run buildLoad extension/dist in chrome://extensions with Developer Mode enabled.
npm run watch
npm run test
npm run test:e2e
npx tsc -p tsconfig.json --noEmit
npm run verify:versions
npm run package:ext
npm run gym:serve- Reproduce the issue in the Gym or with an existing test.
- Decide whether the change belongs in navigation logic, credential logic, storage, popup/options UI, or service-worker state.
- Make the smallest coherent code change.
- Add or update the relevant unit or E2E test.
- Run the narrowest useful checks first, then the broader suite before pushing.
- Update docs when behavior, settings, commands, or workflows changed.
- navigation scoring and click decisions
extension/src/content/capture_isolated.tsextension/src/shared/scoring.ts
- main-world popup/redirect/form enforcement
extension/src/content/main_guard.ts
- credential risk and prompts
extension/src/content/credential_guard.tsextension/src/content/credential_modal.tsextension/src/shared/domain.ts
- storage and persistence
extension/src/shared/storage.tsextension/src/shared/allowlist.ts
- popup and options UI
extension/src/popup/*extension/src/options/*
- rollback and DNR sync
extension/src/sw/sw.ts
- Add a focused HTML fixture under
gym/. - Link it from
gym/index.html. - Add or extend a Playwright spec under
tests/e2e/. - Keep the case deterministic, local, and explainable.
- Prefer one scenario per page instead of a grab-bag page with many unrelated behaviors.
- prefer small, testable modules
- keep content-script work bounded to the interaction being evaluated
- preserve explainability with reason codes and event-log coverage
- avoid network behavior and data exfiltration
- be careful with main-world patching and message-bridge assumptions