skills/browser-extension/cross-browser-compat/SKILL.md
Build browser extensions that work across Chrome, Firefox, Safari, and Edge — API differences, polyfills, and browser-specific manifest requirements.
npx skillsauth add kienbui1995/magic-powers cross-browser-compatInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Feature | Chrome | Firefox | Safari | Edge |
|---------|--------|---------|--------|------|
| Manifest V3 | ✅ Required | ✅ Supported | ✅ Required | ✅ Required |
| Service Workers | ✅ | ✅ (110+) | ✅ | ✅ |
| Side Panel | ✅ (114+) | ❌ (sidebar) | ❌ | ✅ |
| declarativeNetRequest | ✅ | ✅ | ✅ | ✅ |
| chrome.* namespace | ✅ | ✅ (alias) | ✅ (alias) | ✅ |
| browser.* namespace | ❌ native | ✅ native | ✅ native | ❌ native |
Use @mozilla/webextension-polyfill for Promise-based APIs across browsers:
import browser from 'webextension-polyfill';
// Works in Chrome, Firefox, Safari, Edge
const tabs = await browser.tabs.query({ active: true });
browser.* namespace natively (Promise-based)browser_specific_settings in manifest:"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "109.0"
}
}
# Convert Chrome extension to Safari format
xcrun safari-web-extension-converter /path/to/extension --project-location ./safari-ext
// Runtime browser detection
const isFirefox = navigator.userAgent.includes('Firefox');
const isChrome = !!window.chrome && !!window.chrome.runtime;
// Feature detection (preferred)
const hasSidePanel = !!chrome.sidePanel;
chrome.* — Chrome/Edge native; aliased in Firefox/Safaribrowser.* — Firefox/Safari native; NOT available in Chrome without polyfillbrowser_specific_settingswebextension-polyfill or WXT for cross-browser Promise APIs?browser_specific_settings.gecko.id set in manifest?browser.* calls without polyfill in Chrome, missing Gecko ID for Firefoxbrowser.tabs.query() fails in Chrome without polyfill — use chrome.* or add polyfillbrowser_specific_settings.gecko.idcontent-media
Use when designing for XR (AR/VR/MR), choosing interaction modes, or adapting 2D UI patterns for spatial computing
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when executing a structured workflow — select and run a feature, bugfix, refactor, research, or incident template with correct agent and model assignments per phase.