From 7fe110d8fc73b26e4e6c9b093a132e631c353705 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 23:40:00 +0000 Subject: [PATCH] feat: add web-ext tooling for Firefox signing Add package.json with web-ext dev dependency and npm scripts for building, linting, signing, and running the Firefox extension. Signing produces a self-hosted .xpi that persists across restarts without needing the Mozilla store. https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw --- .env.example | 8 ++++++++ .gitignore | 3 +++ README.md | 25 +++++++++++++++---------- package.json | 17 +++++++++++++++++ web-ext-config.js | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 .env.example create mode 100644 package.json create mode 100644 web-ext-config.js diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2da439b --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# Mozilla Add-on API credentials for Firefox extension signing +# Get yours at: https://addons.mozilla.org/developers/addon/api/key/ +# +# Copy this file to .env and fill in your values: +# cp .env.example .env + +WEB_EXT_API_KEY="user:12345:678" +WEB_EXT_API_SECRET="your-secret-here" diff --git a/.gitignore b/.gitignore index 9f8a1ef..364cb9c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ node_modules/ *.crx *.pem *.zip +*.xpi dist/ +.env +web-ext-artifacts/ diff --git a/README.md b/README.md index 42762fc..755adee 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,24 @@ A Chrome extension that intercepts personal information and substitutes it with 5. Click **Load unpacked** → select `dist/chrome/` (or root dir) 6. Navigate to claude.ai — the extension is active -### Firefox +### Firefox (signed, persistent) 1. Clone this repo -2. Run `./build.sh firefox` -3. Open `about:debugging` → **This Firefox** -4. Click **Load Temporary Add-on** → select `dist/firefox/manifest.json` -5. Navigate to claude.ai — the extension is active +2. `npm install` +3. Get your free Mozilla API credentials at https://addons.mozilla.org/developers/addon/api/key/ +4. `cp .env.example .env` and fill in your key + secret +5. `source .env && npm run sign:firefox` +6. Install the `.xpi` file from `dist/firefox-signed/` — drag it into Firefox or use File → Open +7. Navigate to claude.ai — the extension is active -For persistent Firefox installation, package and sign via `web-ext`: -``` -cd dist/firefox && npx web-ext sign --api-key=YOUR_KEY --api-secret=YOUR_SECRET -``` +The signed `.xpi` is permanent — survives restarts, no store listing needed. -No store required for either browser in developer mode. +### Firefox (temporary, for development) +``` +npm install && npm run run:firefox +``` +Opens Firefox with the extension pre-loaded. Reloads on file changes. + +No store required for either browser. ## Architecture diff --git a/package.json b/package.json new file mode 100644 index 0000000..c583360 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "silent-send", + "version": "0.1.0", + "private": true, + "description": "Browser extension that substitutes personal data before sending to AI services", + "scripts": { + "build:chrome": "./build.sh chrome", + "build:firefox": "./build.sh firefox", + "build": "./build.sh both", + "lint:firefox": "npx web-ext lint --source-dir dist/firefox", + "sign:firefox": "./build.sh firefox && npx web-ext sign --source-dir dist/firefox --artifacts-dir dist/firefox-signed --channel unlisted", + "run:firefox": "./build.sh firefox && npx web-ext run --source-dir dist/firefox" + }, + "devDependencies": { + "web-ext": "^8.4.0" + } +} diff --git a/web-ext-config.js b/web-ext-config.js new file mode 100644 index 0000000..8b002f4 --- /dev/null +++ b/web-ext-config.js @@ -0,0 +1,34 @@ +/** + * web-ext configuration for Firefox extension development. + * + * For signing, you need a Mozilla API key and secret. + * Get them at: https://addons.mozilla.org/developers/addon/api/key/ + * + * Set these environment variables before running `npm run sign:firefox`: + * export WEB_EXT_API_KEY="user:12345:678" + * export WEB_EXT_API_SECRET="your-secret-here" + * + * Or create a .env file (git-ignored) and source it: + * source .env && npm run sign:firefox + */ + +module.exports = { + sourceDir: 'dist/firefox', + artifactsDir: 'dist/firefox-signed', + ignoreFiles: [ + 'generate-icons.html', + ], + build: { + overwriteDest: true, + }, + run: { + startUrl: ['https://claude.ai/'], + // Firefox Developer Edition or Nightly recommended for MV3 + // firefox: '/path/to/firefox-developer-edition', + }, + sign: { + channel: 'unlisted', + // API credentials come from environment variables: + // WEB_EXT_API_KEY and WEB_EXT_API_SECRET + }, +};