fix: remove unsupported Firefox permission

This commit is contained in:
mirivlad 2026-07-15 02:53:49 +08:00
parent af629e9864
commit 8597e3b12f
3 changed files with 17 additions and 2 deletions

View File

@ -15,7 +15,7 @@
}
}
},
"permissions": ["alarms", "contextMenus", "idle", "storage", "tabs", "windows", "http://127.0.0.1/*", "http://localhost/*"],
"permissions": ["alarms", "contextMenus", "idle", "storage", "tabs", "http://127.0.0.1/*", "http://localhost/*"],
"background": {
"scripts": ["hostname.js", "activity-tracker.js", "protocol.js", "api.js", "queue.js", "i18n.js", "background.js"]
},

View File

@ -6,7 +6,7 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"build": "node scripts/build-extension.js",
"test": "node scripts/test-hostname.js && node scripts/test-activity-tracker.js && node scripts/test-protocol.js && node scripts/test-i18n.js && node scripts/test-popup-settings.js && node scripts/test-popup-select-style.js && node scripts/test-popup-catalog-fallback.js && node scripts/test-background-i18n.js && node scripts/test-firefox-github-release.js",
"test": "node scripts/test-manifests.js && node scripts/test-hostname.js && node scripts/test-activity-tracker.js && node scripts/test-protocol.js && node scripts/test-i18n.js && node scripts/test-popup-settings.js && node scripts/test-popup-select-style.js && node scripts/test-popup-catalog-fallback.js && node scripts/test-background-i18n.js && node scripts/test-firefox-github-release.js",
"sign:firefox": "./scripts/sign-firefox-xpi.sh",
"release:firefox": "./scripts/release-firefox-xpi.sh",
"publish:firefox": "./scripts/publish-firefox-github-release.sh",

15
scripts/test-manifests.js Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env node
const assert = require('assert');
const chromium = require('../chromium/manifest.json');
const firefox = require('../firefox/manifest.json');
assert.equal(chromium.version, firefox.version, 'browser packages must use the same version');
assert.equal(
firefox.permissions.includes('windows'),
false,
'Firefox does not accept the Chromium-only windows permission'
);
assert.equal(chromium.permissions.includes('windows'), true, 'Chromium still needs the windows permission');
console.log('browser manifest compatibility tests passed');