JSON Viewer: support JSON Lines (JSONL/NDJSON) documents
Categories
(DevTools :: JSON Viewer, enhancement, P3)
Tracking
(relnote-firefox 155+, firefox155 fixed)
People
(Reporter: benoit.goupilleau, Assigned: benoit.goupilleau)
References
Details
Attachments
(7 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
60.03 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
53.39 KB,
image/png
|
Details |
The JSON Viewer currently only handles application/json. This adds support for JSON Lines documents (one JSON value per line) served as application/jsonlines / application/x-ndjson, or as .jsonl files.
- Sniff JSONL/NDJSON content and register the stream converter (
Sniffer.sys.mjs,converter-child.js,components.conf), exposingJSONView.isJsonl. - Parse the document line-by-line into ordered, independently collapsible entries keyed by real file line number (blank lines skipped), via
parseJsonlinjson-viewer.mjsandjsonl-utils.mjs. - Render lines that aren't valid JSON as inline errors (
JsonlLineError) without blocking the rest of the document (JsonPanel.mjs). - Restore the original content type on Save-As, plus docs and browser-chrome test coverage in
browser_jsonview_jsonl.js.
Updated•1 month ago
|
Comment 5•1 month ago
|
||
Hello Benoit, thanks for filing the bug
I guess it has the same goal as Bug 1418633 ?
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
Hello Benoit, thanks for filing the bug
I guess it has the same goal as Bug 1418633 ?
No. It addresses a different type of data/file format: json lines (.jsonl)
Comment 7•1 month ago
|
||
You need to handle pretty print, e.g. data:application/jsonlines,[1,2,3]%0A{"foo":"bar"} becomes
{
"1": [
1,
2,
3
],
"2": {
"foo": "bar"
}
}
Comment 8•1 month ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
I guess it has the same goal as Bug 1418633 ?
Actually it's the same as bug 1603986.
(In reply to Oriol Brufau [:Oriol] from comment #8)
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
I guess it has the same goal as Bug 1418633 ?
Actually it's the same as bug 1603986.
It does also cover that format indeed.
| Assignee | ||
Comment 10•1 month ago
|
||
| Assignee | ||
Comment 11•1 month ago
|
||
(In reply to Oriol Brufau [:Oriol] from comment #7)
You need to handle pretty print, e.g.
data:application/jsonlines,[1,2,3]%0A{"foo":"bar"}becomes{ "1": [ 1, 2, 3 ], "2": { "foo": "bar" } }
I am not sure I understand. Currently it displays the example provided as in Screenshot 2026-07-20 at 09.22.40.png
Comment 12•1 month ago
|
||
Go to Raw Data, then use Pretty Print.
Updated•1 month ago
|
| Assignee | ||
Comment 13•1 month ago
|
||
| Assignee | ||
Comment 14•1 month ago
|
||
(In reply to Benoit from comment #11)
(In reply to Oriol Brufau [:Oriol] from comment #7)
You need to handle pretty print, e.g.
data:application/jsonlines,[1,2,3]%0A{"foo":"bar"}becomes{ "1": [ 1, 2, 3 ], "2": { "foo": "bar" } }I am not sure I understand. Currently it displays the example provided as in Screenshot 2026-07-20 at 09.22.40.png
it now handles pretty print correctly
| Assignee | ||
Comment 15•1 month ago
|
||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/14f9cf3dc34d
https://hg.mozilla.org/mozilla-central/rev/d74e288e47e9
https://hg.mozilla.org/mozilla-central/rev/aee51b0ff455
https://hg.mozilla.org/mozilla-central/rev/75b28caf059f
https://hg.mozilla.org/mozilla-central/rev/cba8d07f81c4
Comment 19•1 month ago
|
||
Did you want to nominate this for the Fx155 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Possible wording:
The JSON Viewer now displays JSON Lines (JSONL/NDJSON) documents, including inline errors for invalid lines.
Comment 20•1 month ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]:
[Affects Firefox for Android]:
[Suggested wording]:
[Links (documentation, blog post, etc)]:
(In reply to Ryan VanderMeulen [:RyanVM] from comment #19)
Did you want to nominate this for the Fx155 relnotes? If so, set the relnote-firefox flag to "?"
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Sure
Possible wording:
The JSON Viewer now displays JSON Lines (JSONL/NDJSON) documents, including inline errors for invalid lines.
Yeah, looks good to me, thanks!
Updated•20 days ago
|
Description
•