feat(firefox): add MV3 compatibility - #671
Conversation
78b0a54 to
085b6e8
Compare
085b6e8 to
6acf449
Compare
There was a problem hiding this comment.
Code review summary
Clean, well-scoped port. I checked the build wiring against the Chrome path rather than reading it in isolation, and it's a faithful mirror:
exportFirefoxJScorrectly dropsoffscreen.jsfrom the bundle list, andexportFirefoxSrcFilescorrectly dropsoffscreen.html— so no orphaned offscreen document ships in the XPI.- The
targetDirHasExportedCommonJsmemo key was added for the new target; missing that would have silently skippedlogManager.js. - The
gulp.src-created-before-awaitpattern inexportFirefoxJSlooks like a race onlogManager.js, butexportChromeJSdoes exactly the same thing. Pre-existing, not introduced here. - esbuild emits
format: "iife", sobackground.scriptswithout"type": "module"loads correctly. The asymmetry with Chrome'sservice_worker+"type": "module"is right, not an oversight. - Manifest diff is exactly what it should be: permissions identical apart from dropping
offscreen,host_permissionsunchanged at<all_urls>,minimum_chrome_versiondropped,browser_specific_settingsadded. No permission drift in either direction, and the version matches Chrome at3.11.2. ClientType.FirefoxExtensionalready existed in the enum, so no renumbering.
Keeping Clipper@OneNote.com as the gecko id is the right call for upgrade continuity on AMO.
Status as of e33a940: no outstanding items.
| # | Raised | Location | Outcome |
|---|---|---|---|
| 1 | getHostname fallback diverged from the offscreen implementation for opaque-origin schemes |
offscreenCommunicator.ts |
Fixed — now builds from protocol/host, identical to offscreen.ts |
| 2 | Unknown-message-type failure mode | offscreenCommunicator.ts |
Withdrawn — my description of the Chrome behaviour was wrong; the original throw was defensible. Current console.warn + undefined is fine |
| 3 | Omits WebExtension.offscreenUrl that chrome/edge set |
firefoxExtension.ts |
Declined, and I agree — the field is never read, so assigning it would preserve dead state |
Nothing blocking from me.
Add a Firefox build target, preserve the existing add-on identity, and fall back when Chrome offscreen APIs are unavailable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e480e5f-43e9-47fc-a6c4-8de1eaec8dfa
6acf449 to
e33a940
Compare
|
Verified both fixes at
One correction I owe you, on the unknown-message-type thread. I re-checked that path after posting and my original claim was wrong: the offscreen handler returns I deleted that thread once I realised it was wrong, not noticing you'd already addressed it — that was premature on my part and made your reply look orphaned. Apologies for the churn. No need to revert: Your reasoning on Nothing outstanding from me. |
Summary
background.scriptsValidation
npm run build:prod