Closed Bug 1235118 Opened 5 years ago Closed 5 years ago
Error while loading URL with .json extension
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
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.
[Tracking Requested - why for this release]: Might siphon people away from Dev Edition if/when they hit this.
Honza, it seems like we should revert your recent changes to force .json to load in the viewer.
Assignee: nobody → odvarko
(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+
Jan, could you fill the uplift request to aurora? Thanks
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
Attachment #8703691 - Flags: approval-mozilla-aurora?
Comment on attachment 8703691 [details] [diff] [review] bug1235118-1.patch Thanks!
Attachment #8703691 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
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
[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.
You need to log in before you can comment on or make changes to this bug.