6

When I click on a *.json or *.patch file in Firefox, it asks me what external application I want to view it in.

However, I don't want to use an external application. It's plain text -- I just want to view it in-browser.

There doesn't seem to be anything in the UI for this.

ChrisF
  • 1,871
  • 1
  • 21
  • 28
mike
  • 3,963
  • 11
  • 30
  • 27

3 Answers3

6

Here's an add-on that might help: "Open in browser"

And here's a KB article that also might help, "MimeTypes"

Greg Meehan
  • 1,166
  • 1
  • 9
  • 16
  • I'd like to register my own mime type / file extension. I read both of those pages and it looks like they say if I really want to I can modify (hack) the mimeTypes file but I'd like to register it the way other mime types are registered. Do you know if I have to install a desktop application or browser plugin to make this happen? – 1.21 gigawatts Feb 14 '16 at 21:40
2

In general you should use the "tools->options->applications" to edit which application is used by default to open different mime types. However if you can't set it that way you can edit the mimeTypes.rdf directly, but this is discouraged.

Adding the following should work (use at your own risk):

<RDF:Description RDF:about="urn:mimetype:application/json"
           NC:value="application/json"
           NC:path="<path to firefox>"
           NC:saveToDisk="false"
           NC:editable="true"
           NC:prettyName="JSON object">
<NC:handlerProp RDF:resource="urn:mimetype:handler:application/json"/>
</RDF:Description>
Iron Savior
  • 938
  • 1
  • 7
  • 14
beggs
  • 396
  • 2
  • 9
1

http://support.mozilla.com/en-US/kb/Managing+file+types

If you open the preferences windows and go to the Applications tab, you should be able to find the content type (application/json) and change its action to "Use Firefox"

gharper
  • 5,425
  • 4
  • 29
  • 35
  • 1
    Nope. You can do that for, say, "HTML document", but for some reason the option isn't there for arbitrary types like JSON. – mike Jun 03 '09 at 20:52