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
This commit is contained in:
@@ -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"
|
||||
@@ -3,4 +3,7 @@ node_modules/
|
||||
*.crx
|
||||
*.pem
|
||||
*.zip
|
||||
*.xpi
|
||||
dist/
|
||||
.env
|
||||
web-ext-artifacts/
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user