Skip to content

Firefox proxy-auth callback parity #3

Description

@infralayers

Background

registerProxyAuth (packages/core/src/auth.ts) currently targets Chrome's MV3 auth callback shape: webRequestAuthProvider permission + asyncBlocking extraInfoSpec, with an async callback.

Firefox's MV3 webRequest.onAuthRequired still uses the older webRequestBlocking permission with a synchronous return value instead of an async callback — this is the single biggest remaining gap between the two browsers (documented in the design spec's Risks section and the repo README's "Known gap" note).

Goal

Make proxy auth work in Firefox too, without breaking the existing Chrome behavior or its tests.

Suggested approach

  • Don't change registerProxyAuth's existing Chrome-shaped behavior or its tests in packages/core/test/auth.test.ts — those should keep passing unchanged.
  • Add browser detection (Chrome vs Firefox — getBrowserAPI() in browserApi.ts already tells you whether chrome or browser was found) and branch the registration logic, OR add a second exported function (e.g. registerProxyAuthFirefox) if branching inside one function gets messy — your call once you're in the code.
  • Whichever you choose, add unit tests for the new Firefox path following the same pattern as the existing Chrome tests (fake API object capturing the listener, no real browser needed).

Definition of done

  • New tests passing alongside the existing 14 (npm test)
  • npm run typecheck clean
  • Manually verified in real Firefox (build on top of the Firefox verification issue, once auth is expected to work)
  • Update the README's "Known gap" note once this is resolved

Suggested owner: whoever built the most context on auth.ts / MV3 internals from module work so far — or pair on this one, it's the most involved remaining task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions