Browser extension for selection-based web translation, built with Plasmo, React, TypeScript, and Manifest V3.
npm installnpm run devLoad the unpacked extension from build/chrome-mv3-dev.
npm run buildProduction output is generated under build/chrome-mv3-prod.
npm run packageThis creates the packaged browser-extension artifact for store submission.
Set provider values before running live translation flows:
export LLM_PROVIDER_FLAVOR="openai-compatible" # or anthropic-compatible
export LLM_API_KEY="your-api-key"
export LLM_BASE_URL="https://api.openai.com"
export LLM_MODEL="gpt-4o-mini"If Plasmo does not pick up shell values during build, set the public equivalents:
export PLASMO_PUBLIC_LLM_API_KEY="$LLM_API_KEY"
export PLASMO_PUBLIC_LLM_BASE_URL="$LLM_BASE_URL"
export PLASMO_PUBLIC_LLM_MODEL="$LLM_MODEL"Runtime behavior:
- target language defaults to
zh-CN - popup settings take precedence over env defaults
- popup display may backfill from env when storage is empty
- actual runtime requests must use stored values only
You can also configure provider settings in the extension popup.
Unit and logic tests:
npm run test:ui-logicDocs integrity check:
npm run check:docsCodex control-layer check:
npm run check:codexSession memory check:
npm run check:memoryMock browser-flow validation:
npm run test:e2e:mockLive provider translation check:
npm run test:liveLive end-to-end browser flow:
npm run test:e2eLocal validation gates:
npm run check:local
npm run check:verifyInstall Playwright's Chromium build once before browser tests:
npx playwright install chromiumThis repository assumes ECC is installed globally. Repo-local control files live in:
AGENTS.md.codex/docs/codex/
Start with:
docs/index.mdAGENTS.md