CI / Build & Test (push) Successful in 3m22s
Firefox MV3 does not support background.service_worker. Split background into background-boot.js (globals) and background-main.js (startup logic); Chrome keeps using importScripts() in background.js, Firefox manifest uses background.scripts with the same file list so the extension loads in both.
13 lines
465 B
JavaScript
13 lines
465 B
JavaScript
/**
|
|
* Boot globals for background (shared by service worker and Firefox scripts context).
|
|
* Loaded first so DEBUG_VERBOSE and browser are available to logs.js and others.
|
|
*/
|
|
const SW_VERSION = 3; // increment to force service worker reload detection
|
|
|
|
/** Set to true for super detailed debug logging. */
|
|
const DEBUG_VERBOSE = false;
|
|
|
|
const browser = (typeof chrome !== 'undefined' && chrome.runtime?.connectNative)
|
|
? chrome
|
|
: (globalThis.browser ?? chrome);
|