web-ext icon indicating copy to clipboard operation
web-ext copied to clipboard

web-ext run should encourage background.scripts when only background.service_worker is present

Open Rob--W opened this issue 1 year ago • 0 comments

MV3 extensions originally developed for Chrome often use the service_worker key. Firefox does not support background.service_worker yet, and the lack of support for that is often a surprise (e.g. https://github.com/mozilla/web-ext/issues/3045).

Firefox 121+ and Chrome 121+ support specifying service_worker and scripts in the background key at once, mentioned at https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/121#changes_for_add-on_developers and documented at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support

Chrome 121 was released in January 2024, Firefox 121 was released in December 2023. This has been long enough for general recommendations to specify scripts and service_worker to make sense. We should detect when a manifest contains background.service_worker without background.page or background.scripts, and recommend the addition of scripts (with a link to documentation) to improve the developer experience.

Rob--W avatar Apr 11 '24 12:04 Rob--W