Closed
Bug 1235118
Opened 7 years ago
Closed 6 years ago
SyntaxError while loading URL with .json extension
Categories
(DevTools :: JSON Viewer, defect)
Tracking
(firefox44 unaffected, firefox45+ fixed, firefox46+ fixed)
RESOLVED
FIXED
Firefox 46
Tracking | Status | |
---|---|---|
firefox44 | --- | unaffected |
firefox45 | + | fixed |
firefox46 | + | fixed |
People
(Reporter: dev.hibiki, Assigned: Honza)
References
Details
Attachments
(1 file)
3.24 KB,
patch
|
jryans
:
review+
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20151224004003 Steps to reproduce: I used Firefox Development Edition 45.0a2 (2015-12-24) to access an .json URL as below: https://docs.npmjs.com/getting-started/using-a-package.json Actual results: Content-Type was text/html, and I caught "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" in JSON Viewer. Expected results: Maybe it should stop using JSON Viewer on .json URL when Content-Type was text/html. Only render as a html page.
Severity: normal → major
Status: UNCONFIRMED → NEW
Component: Untriaged → Developer Tools: JSON Viewer
Ever confirmed: true
Comment 1•7 years ago
|
||
I can confirm this happening on GitHub URLs as well: https://github.com/BYK/superset/blame/master/package.json broke quite horrendously and without clear error messages. I had to turn off `devtools.jsonview.enabled` flag for now.
Blocks: 1230544
status-firefox44:
--- → unaffected
status-firefox45:
--- → affected
status-firefox46:
--- → affected
Comment 5•7 years ago
|
||
[Tracking Requested - why for this release]: Might siphon people away from Dev Edition if/when they hit this.
tracking-firefox45:
--- → ?
tracking-firefox46:
--- → ?
Honza, it seems like we should revert your recent changes to force .json to load in the viewer.
Flags: needinfo?(odvarko)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → odvarko
Flags: needinfo?(odvarko)
Assignee | ||
Comment 7•7 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #6) > Honza, it seems like we should revert your recent changes to force .json to > load in the viewer. Yes, patch attached. (I removed also getFileExtension() in the end, but let me know if you feel like this one should stay) Honza
Attachment #8703691 -
Flags: review?(jryans)
Comment on attachment 8703691 [details] [diff] [review] bug1235118-1.patch Review of attachment 8703691 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks! We'll also need to request uplift to Dev. Ed once this lands in m-c.
Attachment #8703691 -
Flags: review?(jryans) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/acbe4e7e6c00
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
Comment 11•6 years ago
|
||
Jan, could you fill the uplift request to aurora? Thanks
Assignee | ||
Comment 12•6 years ago
|
||
Comment on attachment 8703691 [details] [diff] [review] bug1235118-1.patch Approval Request Comment [Feature/regressing bug #]: Backout patch from bug 1230544. The patch treats URLs with .json extension as application/json docs which is wrong. [User impact if declined]: URLs with .json extensions are broken [Describe test coverage new/current, TreeHerder]: n/a [Risks and why]: n/a [String/UUID change made/needed]: n/a
Flags: needinfo?(odvarko)
Attachment #8703691 -
Flags: approval-mozilla-aurora?
Comment 13•6 years ago
|
||
Comment on attachment 8703691 [details] [diff] [review] bug1235118-1.patch Thanks!
Attachment #8703691 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 14•6 years ago
|
||
Just adding that I experienced this too for JSON in Chromium's source, which is linked from MDN. https://chromium.googlesource.com/chromium/src/+/master/extensions/common/api/runtime.json
Comment 15•6 years ago
|
||
bugherderuplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/32512bb6e431
Comment 18•6 years ago
|
||
[bugday-20160323] Status: RESOLVED,FIXED -> UNVERIFIED Comments: JSON should not open as file extension is html Component: Name Firefox Version 46.0b9 Build ID 20160322075646 Update Channel beta User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 OS Windows 7 SP1 x86_64 Expected Results: json should rendering page. Actual Results: .json directly opens with browser having HTML/CSS contents.
Updated•4 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•