feat: add Firefox support with cross-browser compatibility

Add manifest.firefox.json for Firefox MV3 (gecko ID, background
scripts instead of service_worker, options_ui). Introduce
browser-polyfill.js shim so all modules use whichever API is
available (browser.* or chrome.*). Add build.sh to target
chrome, firefox, or both.

https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
Claude
2026-03-25 23:36:59 +00:00
parent 4576597e64
commit 3ef5df7efb
8 changed files with 191 additions and 36 deletions
+20
View File
@@ -0,0 +1,20 @@
/**
* Minimal browser API compatibility layer.
*
* Firefox exposes `browser.*` (Promise-based) and polyfills `chrome.*`.
* Chrome only has `chrome.*` (callback-based, but storage/runtime are
* Promise-based in MV3). This normalizes to whichever is available.
*/
const api =
typeof browser !== 'undefined' && browser.runtime
? browser
: typeof chrome !== 'undefined'
? chrome
: null;
if (!api) {
console.error('[Silent Send] No WebExtension API found');
}
export default api;