Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 667533 - Display application/json data as text
: Display application/json data as text
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
: -- enhancement with 1 vote (vote)
: mozilla8
Assigned To: Markus Stange [:mstange]
Depends on: 788995
  Show dependency treegraph
Reported: 2011-06-27 11:18 PDT by Liam Morland
Modified: 2015-05-02 12:54 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (6.70 KB, patch)
2011-08-01 08:53 PDT, Markus Stange [:mstange]
bzbarsky: review+
Details | Diff | Splinter Review
with commit msg (6.83 KB, patch)
2011-08-01 09:27 PDT, Markus Stange [:mstange]
no flags Details | Diff | Splinter Review

Description Liam Morland 2011-06-27 11:18:28 PDT
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
Comment 1 Markus Stange [:mstange] 2011-08-01 08:53:47 PDT
Created attachment 549818 [details] [diff] [review]

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?
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2011-08-01 09:06:19 PDT
Comment on attachment 549818 [details] [diff] [review]

Yeah, it's safe to assume that.  The web depends on it, and the HTML5 spec requires that behavior.
Comment 3 Markus Stange [:mstange] 2011-08-01 09:27:52 PDT
Created attachment 549828 [details] [diff] [review]
with commit msg
Comment 4 Markus Stange [:mstange] 2011-08-08 11:35:51 PDT
Comment 5 :Ehsan Akhgari (Away Oct 25 - Nov 9) 2011-08-09 08:57:04 PDT
Comment 6 2013-06-16 02:43:06 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.