From 1c107274c3398aea34759478c1c504bf8575c878 Mon Sep 17 00:00:00 2001 From: Nawid Salehie <102778966+Nawid3333@users.noreply.github.com> Date: Sun, 6 Sep 2026 20:48:23 +0200 Subject: [PATCH] Don't request the contextualIdentities permission in Firefox builds Firefox scopes that permission to the browser.contextualIdentities namespace - querying and editing container definitions - which nothing in the project calls. The container support in background.mjs's DOWNLOAD handler only reads sender.tab.cookieStoreId and passes it to tabs.create(), and cookieStoreId is gated on "cookies", which is still requested. Verified: build_firefox_libre's manifest still requests storage, tabs, webRequest, declarativeNetRequest, downloads and cookies, so container downloads are unaffected. Co-Authored-By: Claude Opus 5 --- build.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.mjs b/build.mjs index 31858b7c..abf3781f 100644 --- a/build.mjs +++ b/build.mjs @@ -314,7 +314,11 @@ async function buildFirefoxLibre() { const manifestPath = path.join(firefoxLibreBuildDir, 'manifest.json'); const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); - manifest.permissions.push('downloads', 'cookies', 'contextualIdentities'); + // 'contextualIdentities' is not requested: Firefox scopes that permission + // to the browser.contextualIdentities namespace, which nothing here calls. + // The container support in background.mjs only reads a tab's + // cookieStoreId and passes it to tabs.create(), which 'cookies' covers. + manifest.permissions.push('downloads', 'cookies'); // remove the userscripts permission manifest.permissions = manifest.permissions.filter((permission) => permission !== 'userScripts'); @@ -371,7 +375,8 @@ async function buildFirefoxDist() { type: 'module', }; - manifest.permissions.push('downloads', 'cookies', 'contextualIdentities'); + // see the matching comment in buildFirefoxLibre() + manifest.permissions.push('downloads', 'cookies'); // remove the userscripts permission manifest.permissions = manifest.permissions.filter((permission) => permission !== 'userScripts');