This file provides guidance to coding agents when working with this repository.
This is a cross-browser extension called "Marks: Text Highlighter". It supports multi-color text highlighting, highlight management, minimap navigation, keyboard shortcuts, and multilingual UI.
npm test- Run Jest unit/integration tests (tests/)npx playwright test- Run Playwright E2E tests (e2e-tests/)
npm run deploy- Build Chrome extension files intodist/npm run deploy:firefox- Build Firefox extension files intodist-firefox/
npm run version-deploy -- <version> chrome- Bumpmanifest.json, set debug flags for release, build Chrome package, zip tooutputs/npm run version-deploy -- <version> firefox- Bumpmanifest-firefox.json, set debug flags for release, build Firefox package, zip tooutputs/
- Chrome: load unpacked extension from
dist/viachrome://extensions - Firefox: load temporary add-on from
dist-firefox/manifest.jsonviaabout:debugging
background.js: extension background entry pointcontent-scripts/content.js: content entry point loaded on all pagespopup.js+popup.html: popup UIpages-list.js+pages-list.html: page-level highlight list UI
background/context-menu.js: context menu behaviorbackground/message-router.js: runtime message routingbackground/settings-service.js: extension settings managementbackground/sync-service.js: synchronization and conflict handling
content-scripts/content-common.js: shared content-side APIs/utilitiescontent-scripts/content-core.js: highlight core logiccontent-scripts/controls.js: in-page highlight controlscontent-scripts/minimap.js: minimap UI and interactions
shared/browser-api.js: browser compatibility wrapper (browser/chrome)shared/logger.js: debug logging switch and logger helpersshared/modal.js,shared/modal.css,shared/localized-modal.js: reusable modal systemshared/import-export-schema.js: import/export data schema utilities
constants/storage-keys.js: storage key definitions shared across modules
- Chrome manifest:
manifest.json - Firefox manifest:
manifest-firefox.json - Firefox-specific settings (gecko id/min versions) are defined in
manifest-firefox.json
Localization files are in _locales/.
Current locales: en, es, ja, ko, zh.
- Highlights and metadata are stored in extension local storage.
- Page metadata uses
${url}_metakeys. - Custom colors are stored separately from highlight groups.
- Sync/tombstone handling is implemented in background sync modules.
Release builds force debug off through scripts/version-deploy.cjs by updating:
shared/logger.jscontent-scripts/content-common.js
scripts/deploy.cjs: copies production files into browser-specific dist directoriesscripts/version-deploy.cjs: version bump + release build + zip packaging
Reusable release workflow skill:
skills/version-release/SKILL.md