fix(firefox): ajoute background.scripts fallback (compat MV3 Firefox/AMO)

Mozilla AMO rejetait le .xpi avec :
  Unsupported "/background/service_worker" manifest property used without
  "/background/scripts" property as Firefox-compatible fallback.

build.sh ajoute maintenant 'scripts: [background.js]' à background.* dans
le manifest Firefox uniquement (Chrome ignore 'scripts' quand
'service_worker' est présent ; Firefox ignore 'service_worker' et utilise
'scripts'). Les deux navigateurs chargent le même background.js.

Sha256 du .xpi v2026.5.41 mis à jour dans firefox-updates.json.
This commit is contained in:
Quentin Rouiller
2026-04-27 03:02:38 +02:00
parent 67708d1ad3
commit 0327a55c74
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -33,6 +33,15 @@ m['browser_specific_settings'] = {
'data_collection_permissions': {'required': ['none']}
}
}
# Firefox MV3 ne supporte pas (encore) 'service_worker' → AMO rejette.
# On ajoute 'scripts' (event page) comme fallback compatible Firefox.
# Chrome ignore 'scripts' quand 'service_worker' est présent ; Firefox
# ignore 'service_worker' et utilise 'scripts'. Les deux navigateurs
# chargent ainsi le même background.js.
bg = m.get('background', {})
if 'scripts' not in bg:
bg['scripts'] = ['background.js']
m['background'] = bg
with open('dist/firefox/manifest.json', 'w') as f:
json.dump(m, f, indent=2, ensure_ascii=False)
f.write('\n')