Skip to content

Commit

Permalink
Update Manifest for compatibility with Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
graphemecluster committed Oct 10, 2024
1 parent 138cae2 commit 00b7c15
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_extensionName__",
"version": "0.5.0",
"version": "0.5.1",
"description": "__MSG_extensionDescription__",
"icons": {
"48": "icons/48.png",
Expand All @@ -26,5 +26,10 @@
"default_icon": "icons/96.png",
"default_title": "__MSG_extensionName__",
"default_popup": "src/popup/index.html"
},
"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inject-jyutping",
"version": "0.5.0",
"version": "0.5.1",
"description": "A browser extension that adds Cantonese pronunciation (Jyutping) on Chinese characters",
"type": "module",
"scripts": {
Expand All @@ -9,7 +9,7 @@
"start": "parcel watch manifest.json --config @parcel/config-webextension --host localhost",
"prebuild": "npm run lint && npm run clear",
"build": "parcel build manifest.json --config @parcel/config-webextension --no-source-maps --no-cache",
"postbuild": "node scripts/replace-surrogates.js",
"postbuild": "node scripts/replace-surrogates.js && node scripts/patch-manifest.js",
"lint": "tsc -p tsconfig.json"
},
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions scripts/patch-manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { readFile, writeFile } from 'fs/promises';

const path = './dist/manifest.json';
const manifest = JSON.parse(await readFile(path, 'utf-8'));
manifest.background.scripts = [manifest.background.service_worker];
manifest.background.persistent = true;
await writeFile(path, JSON.stringify(manifest));

0 comments on commit 00b7c15

Please sign in to comment.