Closed Bug 667533 Opened 10 years ago Closed 10 years ago
Display application/json data as text
When loading a URL with MIME type application/json, Firefox should display it as plain text instead of offering to download the file. Reproducible: Always Steps to Reproduce: Load a URL containing JSON data served with application/json MIME type. Actual Results: Firefox offers to download the file. Expected Results: Firefox displays the JSON as plain text. A patch to fix this in in bug #606488
This is the same patch as in bug 606488, but also contains a test. I'm only requesting review on the test. I'm not sure that I'm not making any wrong assumptions there. For example, is it safe to assume that plain text documents have a document and a body?
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Attachment #549818 - Flags: review?(bzbarsky)
Comment on attachment 549818 [details] [diff] [review] v1 Yeah, it's safe to assume that. The web depends on it, and the HTML5 spec requires that behavior.
Attachment #549818 - Flags: review?(bzbarsky) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Is there some central way of detecting whether a MIME type is text based rather than patching all over the place (e.g. bug 882995 was recently filed to "catch up")? My best idea is to look at the document - if it's a MediaDocument then you probably don't want to allow View Source on it, while if it's XUL or SVG then you probably don't want to FAYT either.
You need to log in before you can comment on or make changes to this bug.