mozilla / addons-linter

🔍 Firefox Add-ons linter, written in JavaScript. 👁
Mozilla Public License 2.0
314 stars 144 forks source link

Emit helpful message when background.service_worker is used without background.scripts/page #5252

Open Rob--W opened 5 months ago

Rob--W commented 5 months ago

addons-linter was patched before to emit only a warning when background.service_worker is used without scripts/page (https://github.com/mozilla/addons-linter/issues/5152). The warnings are still not very helpful.

Instead of a generic "/background/service_worker" is not supported.", we should print a helpful message that encourages the use of scripts. For more details on why and what, see my write-up for web-ext run at https://github.com/mozilla/web-ext/issues/3101

The relevant implementation was last touched for #5152, at https://github.com/mozilla/addons-linter/blob/40fa69a2f0274dc2c4bd4bb6c1a6d35ac979416e/src/parsers/manifestjson.js#L568-L576

┆Issue is synchronized with this Jira Task

Rob--W commented 3 months ago

For more info, we can link to the documentation at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support