veracitylab / DOM-Instrumentation-to-Display-Provenance-Data

Honours Project: JavaScript program to Instrument DOM elements manipulated by Ajax calls to facilitate in exposing Provenance Data
0 stars 0 forks source link

`manifest.json` conflict between Chrome and Firefox #3

Open wtwhite opened 6 months ago

wtwhite commented 6 months ago

We need to use a service worker in a browser extension, but although Chrome and Firefox nominally both support Chrome's extension model, their syntaxes conflict: Chrome needs manifest.json to contain a service_worker key, while Firefox needs it to contain a scripts key.

For now, I'll support Chrome ( + Chromium). Supporting Firefox only requires changing one line in manifest.json.

wtwhite commented 6 months ago

Supporting Firefox will be harder than this, since under Manifest V3, Firefox's background scripts (the closest equivalent to Chrome's service workers) can no longer be persistent, and non-persistent scripts unload after a few seconds of activity, so they can't, e.g., use global variables. 😞

wtwhite commented 6 months ago

It seems Chrome service workers can also shut down after 30s of inactivity... So we shouldn't be using global variables in any case.