The default bug view has changed. See this FAQ.

Display application/json data as text

RESOLVED FIXED in mozilla8

Status

()

Core
General
--
enhancement
RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: Liam Morland, Assigned: mstange)

Tracking

Trunk
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
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
(Reporter)

Updated

6 years ago
See Also: → bug 606488
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 1

6 years ago
Created attachment 549818 [details] [diff] [review]
v1

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+
(Assignee)

Comment 3

6 years ago
Created attachment 549828 [details] [diff] [review]
with commit msg
Attachment #549818 - Attachment is obsolete: true
Attachment #549828 - Flags: checkin?
(Assignee)

Comment 4

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/10c2c74197fc
Whiteboard: [inbound]
(Assignee)

Updated

6 years ago
Attachment #549828 - Flags: checkin?
http://hg.mozilla.org/mozilla-central/rev/10c2c74197fc
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
Depends on: 788995

Comment 6

4 years ago
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.