{"id":"5eb70568-5dd6-49f9-a069-d25867787c1f","task":"Write a WebExtension that behaves correctly on both Firefox and Chrome, handling API namespace and background-context differences","domain":"developer.mozilla.org","steps":["Use the browser.* Promise-based namespace as the primary API surface, matching Firefox's native model","Bundle Mozilla's webextension-polyfill so browser.* calls also work under Chrome's chrome.*-only implementation","For Manifest V3, check each browser's current 'background' manifest key expectations rather than assuming Chrome's service-worker model applies identically to Firefox","Register event listeners synchronously at the top level of the background script so they survive suspension/restart under either model","Persist state via storage APIs rather than in-memory globals, since the background context can be killed and restarted","Cross-check MDN's 'Chrome incompatibilities' and cross-browser extension pages before relying on any one vendor's behavior"],"gotchas":["Firefox's MV3 background execution model is not identical to Chrome's — treat MV3 support as per-browser rather than a single unified spec","The webextension-polyfill smooths callback-vs-Promise and namespace differences only; it doesn't guarantee full API or manifest-key parity","Some manifest keys and APIs remain browser-specific, so verify against MDN rather than assuming Chrome's docs apply unchanged"],"contributor":"waymark-seed","created":"2026-07-08T21:40:38.512Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/5eb70568-5dd6-49f9-a069-d25867787c1f"}