You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spike: Cross-Browser Support - Technical Analysis #45
The Lytics Dev Tools extension has an excellent foundation for cross-browser support with ~85% compatibility already achieved). The existing Firefox build system demonstrates forward-thinking architecture. Firefox's sidebar_action API provides direct equivalent to Chrome's Side Panel, dramatically reducing implementation complexity.
📊 Current State Analysis
✅ Already Cross-Browser Compatible
Storage System: Uses standard WebExtension APIs with polyfill
Content Scripts: Standard implementation works across browsers
Activity
anupsingh244 commentedon Sep 2, 2025
Summary
The Lytics Dev Tools extension has an excellent foundation for cross-browser support with ~85% compatibility already achieved). The existing Firefox build system demonstrates forward-thinking architecture. Firefox's sidebar_action API provides direct equivalent to Chrome's Side Panel, dramatically reducing implementation complexity.
📊 Current State Analysis
✅ Already Cross-Browser Compatible
🎉 New Discovery: Firefox Sidebar Support
🔧 Technical Compatibility Matrix
🚨 Critical API Dependencies
1. Sidebar APIs (Minor Issue)
Chromechrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true });chrome.sidePanel.setOptions({ tabId, path: 'sidepanel.html', enabled: true });Firefox - Direct equivalent!browser.sidebarAction.setPanel({ panel: 'sidebar.html' });browser.sidebarAction.open();Impact: Core UI functionality
Firefox Solution: ✅ Native sidebar_action API (same UX!)
Effort: Low (API wrapper only)
2. Service Worker vs Background Scripts
Chrome (Manifest V3) - Service Worker"background": { "service_worker": "background.js", "type": "module" }Firefox - Persistent Background Script"background": { "scripts": ["background.js"], "persistent": true }Impact: Background processing
Status: ✅ Already handled by manifest parser
Effort: None (already implemented)
3. Declarative Net Request
Current rules.json implementation{"id": 1,"action": { "type": "allow" },"condition": { "urlFilter": ".*lytics\\.io/.*" }}Impact: Network traffic monitoring
Firefox Support: Limited (fallback to webRequest needed)
Effort: Medium (dual implementation)
🏗️ Simplified Architecture Assessment
Current Chrome API Usage Locations
🛠️ Simplified Implementation Strategy
P1: Sidebar API Wrapper (1 day)
New: src/shared/browser/sidebar.tsinterface SidebarAPI {open(): Promise<void>;setPanel(options: { panel: string; tabId?: number }): Promise<void>;setPanelBehavior?(options: { openPanelOnActionClick: boolean }): Promise<void>;}export const sidebarAPI: SidebarAPI = {open: async () => {if (typeof chrome !== 'undefined' && chrome.sidePanel) {return; // Chrome: Opens automatically on action click} else if (typeof browser !== 'undefined' && browser.sidebarAction) {return browser.sidebarAction.open(); // Firefox: Explicit open}},setPanel: async (options) => {if (typeof chrome !== 'undefined' && chrome.sidePanel) {return chrome.sidePanel.setOptions({tabId: options.tabId,path: options.panel,enabled: true});} else if (typeof browser !== 'undefined' && browser.sidebarAction) {return browser.sidebarAction.setPanel({ panel: options.panel });}}};P2: Enhanced Manifest Management (0.5 days)
Enhanced utils/manifest-parser/index.tsstatic convertToFirefoxCompatibleManifest(manifest: Manifest) {const manifestCopy = { ...manifest } as { [key: string]: unknown };Convert Chrome sidePanel to Firefox sidebar_actionif (manifest.side_panel) {manifestCopy.sidebar_action = {default_panel: manifest.side_panel.default_path,default_title: manifest.name,default_icon: manifest.action?.default_icon || "icon-34.png"};delete manifestCopy.side_panel;}Existing Firefox conversions...return manifestCopy as Manifest;}P3: Network Monitoring Fallback (2 days)
Declarative Net Request (Chrome/Edge) + webRequest (Firefox/Safari)if (browser.declarativeNetRequest) {browser.declarativeNetRequest.updateDynamicRules(rules);} else {browser.webRequest.onBeforeRequest.addListener(handler, filter, options);}P4: Safari DevTools Panel (1 day)[Need to explore more on this]
Safari-specific fallback to DevTools panelif (isSafari) {chrome.devtools.panels.create('Lytics Dev Tools', 'icon.png', 'panel.html');}📋 Technical Requirements
Dependencies
Build System Enhancements
package.json - Enhanced scripts (mostly exist){"build:chrome": "cross-env __CHROME__=true vite build","build:firefox": "cross-env __FIREFOX__=true vite build", // ✅ exists"build:edge": "cross-env __EDGE__=true vite build","build:safari": "cross-env __SAFARI__=true vite build","build:all": "run-p build:chrome build:firefox build:edge"}📈 Effort Estimation
Total Estimated Effort: 6 days
🎯 Browser Support Strategy
Implementation Priority
User Experience Impact
🚀 Success Metrics
🎯 Recommended Approach
Immediate Actions (Spike Outcomes)
Implementation Priority
🚀 Next Steps