Skip to content

Don't request the contextualIdentities permission in Firefox builds - #549

Closed
Nawid3333 wants to merge 1 commit into
Andrews54757:mainfrom
Nawid3333:fix/unused-firefox-permissions
Closed

Don't request the contextualIdentities permission in Firefox builds#549
Nawid3333 wants to merge 1 commit into
Andrews54757:mainfrom
Nawid3333:fix/unused-firefox-permissions

Conversation

@Nawid3333

Copy link
Copy Markdown
Contributor

Summary

build.mjs requests contextualIdentities in both Firefox targets, but nothing in the project calls browser.contextualIdentities.*. Firefox scopes that permission to exactly that namespace — querying and editing container definitions — so it's dead weight.

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 this still requests.

Why it's worth doing

Fewer permissions means a smaller install prompt and one less thing for a store reviewer to ask about.

A warning worth recording

cookies must stay. I very nearly removed it too, on the strength of a grep for .cookies. that found nothing — but cookieStoreId doesn't match that pattern, and Mozilla's own schema is explicit:

"cookieStoreId": {"type":"string","description":"The cookie store ID of the
contextual identity; requires \"cookies\" permission."}

Dropping cookies silently breaks container downloads while leaving every test green. Flagging it in case anyone else runs the same grep and reaches the same wrong conclusion.

Test plan

  • node build.mjs builds successfully
  • Built firefox-libre manifest still requests storage, tabs, webRequest, declarativeNetRequest, downloads, cookies — container downloads unaffected
  • No browser.contextualIdentities call site anywhere in the repo

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Nawid3333 added a commit to Nawid3333/FastStream that referenced this pull request Sep 7, 2026
…point

Phase 10 is no longer "not started": Andrews54757#548, Andrews54757#549, Andrews54757#550 and Andrews54757#551 are open
upstream, with follow-up comments on Andrews54757#547 and Andrews54757#546. The unlisted AMO
submission pipeline ran end to end on 2026-09-07 (local sign plus the
publish-amo workflow). The baseline re-capture is also recorded as done -
the workspace-level baseline now holds the modernised fork at cd728ab
(852 files, spot-verified), with the original V1.3.77 upstream build
archived separately.
@Andrews54757

Copy link
Copy Markdown
Owner

contextualIdentities was added in prior attempt to fix bug where downloads failed in specific firefox containers. Unfortunately firefox did not expose a mechanism for extensions to know about or control certain partitions so the permission currently does nothing. It will be important in the future once https://bugzilla.mozilla.org/show_bug.cgi?id=1917842 is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants