Chrome ignores JavaScript comments in manifest.json but Web Store disallows them |
|||
Issue description
Version: Version 51.0.2664.1 canary (64-bit)
OS: Windows 7
What steps will reproduce the problem?
1. Create a Chrome Extension.
In manifest.json, add a JavaScript comment:
{
"manifest_version": 2,
// TODO: Pick a better name
"name": "moarTLS Analyzer",
"short_name": "moarTLS",
"description": "Analyzes webpages for non-secure link references.",
"version": "0.1.0.3",
...
2. Chrome has no problem loading this extension via "Load unpacked extension..."
3. Attempt to upload the Extension to the Chrome Web Store.
OBSERVE: Upload Rejected
The problem is that if the developer subsequently attempts to upload the extension to the Web Store, it is rejected with an "invalid character" error. The line numbers in the error message are inaccurate, but the problem is caused by the fact that the store is using a more strict JSON parser, and the JSON standard does not allow for comments.
We should probably make Chrome's parser as strict as the Store's.
,
May 6 2016
over to jawag@ for webstore triage. Chrome deliberately ignores comments in the json; is there a way we could have the webstore do the same?
,
May 13 2016
@konsto, could you provide some recommendations here?
,
May 16 2016
Yep, we have internal bug 27041131 for CWS to track this. We should switch from org.json to GSON since later provides better tolerance for incorrect JSON (JSON actually cannot have comments in it by default http://stackoverflow.com/questions/244777/can-i-use-comments-inside-a-json-file).
,
May 16 2016
how else does GSON differ? We need to also make sure that the store doesn't allow things that chrome wouldn't. |
|||
►
Sign in to add a comment |
|||
Comment 1 by lima...@gmail.com
, Mar 2 2016