Manifest.json should mention it allows comments?

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json does not mention that it supports comments in the JSON. (same as with translations in _locales etc.)

However, you do mention in
https://blog.mozilla.org/addons/2016/07/14/webextensions-support-on-amo/

…that you support comments in the JSON files, because Chromes does.
So should not this be documented, if it is now “officially” supported?

1 Like

Yes, good call! I checked the spec and it says that this is standard behavior for browser extensions, so I have updated the page: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json.

1 Like

Thanks, this just also needs to be updated for the _localesJSOn files, too. There it also works/is allowed.

@wbamberg
That is an odd situation which I had also enquired about long time ago.

While WebExtension manifest.json tolerates comments, since WE sees it as a JS object, strictly speaking JSON does not allow comments so it will be an invalid JSON.

Therefore, if manifest.json is regarded as a JS object resembling a JSON, then it is fine but as a valid JSON, comments are not allowed.

It is the same case with messages.json.

Finally, since the extension .json is used, one would think that it should adhere to JSON specification.