Add Firefox-specific manifest and split packaging for Chrome zip vs XPI
CI / Build & Test (push) Successful in 3m21s
CI / Build & Test (push) Successful in 3m21s
- Add extension/manifest_firefox.json (no key, moz-extension://*/* for web_accessible_resources) for correct Firefox MV3 behavior - Update pack-extension.js: zip excludes manifest_firefox.json; XPI built separately with manifest_firefox.json as manifest.json - Update generate-extension-id.js to set gecko.id in manifest_firefox.json when present (no key in Firefox manifest) - Document dual-manifest layout and pack/generate-id behavior in CONTRIBUTING.md
This commit is contained in:
@@ -26,7 +26,8 @@ cd native-host && npm install
|
||||
Holesail-Browser/
|
||||
├── extension/ # Browser extension (MV3, Chrome + Firefox)
|
||||
│ ├── background.js # Service worker entry point
|
||||
│ ├── manifest.json # Extension manifest
|
||||
│ ├── manifest.json # Extension manifest (Chrome)
|
||||
│ ├── manifest_firefox.json # Firefox-only manifest (packed as manifest.json in .xpi)
|
||||
│ ├── background/ # Background module files
|
||||
│ └── dashboard/ # Dashboard UI (HTML + JS modules)
|
||||
├── native-host/ # Native host process (runs under Bare runtime)
|
||||
@@ -72,7 +73,7 @@ This runs `scripts/run-install.js`, which delegates to `scripts/install.sh` (mac
|
||||
|
||||
1. Open `about:debugging#/runtime/this-firefox`
|
||||
2. Click **Load Temporary Add-on**
|
||||
3. Select `extension/manifest.json`
|
||||
3. Select `extension/manifest.json` (for development). For a permanent install, use the packed `.xpi`, which contains the Firefox manifest.
|
||||
|
||||
## npm scripts reference
|
||||
|
||||
@@ -106,11 +107,11 @@ Output goes to `releases/<platform>/holesail-browser-host[.exe]`. Supported targ
|
||||
|
||||
### `scripts/pack-extension.js`
|
||||
|
||||
Reads the version from `extension/manifest.json` and creates `releases/Holesail-Browser-<version>.zip` (Chrome) and `.xpi` (Firefox) by archiving the `extension/` directory, excluding `.map` files.
|
||||
Reads the version from `extension/manifest.json` and creates `releases/Holesail-Browser-<version>.zip` (Chrome) and `.xpi` (Firefox). The zip includes `manifest.json` (Chrome manifest) and excludes `manifest_firefox.json`. The XPI includes all extension files but uses `manifest_firefox.json` as `manifest.json`. `.map` files are excluded from both.
|
||||
|
||||
### `scripts/generate-extension-id.js`
|
||||
|
||||
Generates a unique Chrome extension ID (RSA-2048 public key → SHA-256 → first 16 bytes → base-26 `a–p` encoding) and a unique Firefox ID (`holesail-browser-<8 random hex bytes>@example.org`). Updates both `extension/manifest.json` and `com.holesail.browser.json`. Run automatically by the installer so each installation gets its own ID.
|
||||
Generates a unique Chrome extension ID (RSA-2048 public key → SHA-256 → first 16 bytes → base-26 `a–p` encoding) and a unique Firefox ID (`holesail-browser-<8 random hex bytes>@example.org`). Updates `extension/manifest.json` (key + gecko.id), `extension/manifest_firefox.json` if present (gecko.id only), and `com.holesail.browser.json`. Run automatically by the installer so each installation gets its own ID.
|
||||
|
||||
### `scripts/run-install.js`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user