Reference browser extension for client-side validation of HTMLTrust signed content. Verifies cryptographic signatures embedded in web pages using the <signed-section> element protocol.
This is a companion to the HTMLTrust specification.
When you visit a web page containing signed content, this extension:
- Detects
<signed-section>elements carryingsignature,keyid,algorithm, andcontent-hashattributes - Verifies signatures by fetching the author's public key and validating the cryptographic signature
- Displays trust indicators (badges, outlines) showing verification status
- Queries optional trust directories for author reputation and endorsements
- Enables community trust/distrust voting on authors and content
The codebase is split into shared (reusable) and browser-specific layers:
src/
├── core/ # ✅ SHARED — reusable across any browser
│ ├── api/ # REST clients for HTMLTrust trust directory server
│ ├── auth/ # Authentication service (API key management)
│ ├── common/ # Types, constants, utilities
│ ├── content/ # Content processor (DOM canonicalization, hashing, metadata extraction)
│ └── storage/ # Storage abstraction (interface + in-memory implementation)
├── platforms/ # 🔴 BROWSER-SPECIFIC — one adapter per browser
│ ├── common/ # PlatformAdapter interface (storage, messaging, tabs, scripting)
│ ├── chromium/ # Chrome / Edge implementation + Manifest V3
│ ├── firefox/ # Future — Manifest V2 (manifest only, no adapter yet)
│ └── safari/ # Future — Manifest V3 (manifest only, no adapter yet)
├── ui/ # ✅ SHARED — React components for popup, options, and in-page UI
│ ├── components/ # Reusable widgets (Button, MetadataInput, ProfileManager, etc.)
│ ├── popup/ # Extension popup (verification status, signing controls)
│ └── options/ # Extension options page (settings, profiles, server config)
├── background/ # Service worker entry point
├── content-scripts/ # Content script entry point
└── assets/ # Icons, CSS
- Create
src/platforms/<browser>/adapter.tsimplementing thePlatformAdapterinterface - Create
src/platforms/<browser>/manifest.jsonfor that browser - Update
webpack.config.jsto add the new target - The shared
core/,ui/,background/, andcontent-scripts/code works unchanged
- TypeScript with strict mode
- React 19 for UI components
- Webpack 5 with per-browser build targets
- Jest + ts-jest for testing
- js-sha256 + simhash-js for content hashing
- Node.js 18+
git clone https://github.com/HTMLTrust/htmltrust-browser-reference.git
cd htmltrust-browser-reference
npm installBuild for a specific browser:
npm run build:chrome # → build/chromium/
npm run build:firefox # → build/firefox/
npm run build:safari # → build/safari/Or build all:
npm run build # Builds all targets + creates zipsnpm run dev:chrome # Watch mode for Chromium- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" → select the
build/chromium/folder
npm test # Run all tests
npm run test:coverage # With coverage report├── docs/ # Architecture and design documentation
├── scripts/ # Build and packaging scripts
├── src/ # Source code (see Architecture above)
├── package.json
├── tsconfig.json
├── webpack.config.js
├── jest.config.js
└── .eslintrc.js
- ✅ Chromium adapter fully implemented
- ✅ Core content verification pipeline
- ✅ React popup and options UI
- ⬜ Firefox adapter (manifest only — needs
browser.*API adapter) - ⬜ Safari adapter (manifest only — needs adapter)
| Repository | Description |
|---|---|
| htmltrust-spec | The HTMLTrust specification and paper |
| htmltrust-server-reference | Reference trust directory API server |
| htmltrust-cms-reference | Reference CMS plugin (WordPress) |
| htmltrust-website | Project website |
MIT