Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding custom content-types to Firefox application handler?

In Firefox, whenever I request a page that returns a Content-type of "application/json", Firefox saves the file into /tmp but then says "/tmp/json.php could not be opened, because the associated helper application does not exist. Change the association in your preferences." Well, I go into Edit > Preferences > Applications, and there's no content type listed there that seems to have anything to do with application/json.

Is it possible to add an entry for this type? (Or for a random custom type I make up, like "foo/bar"?) I see a file called mimeTypes.rdf which looks promising.

like image 740
dirtside Avatar asked Dec 12 '09 01:12

dirtside


2 Answers

Ok, it is the mimeTypes.rdf file which controls these things, so I'll just edit it by hand. (Or go find an add-on.)

like image 99
dirtside Avatar answered Sep 30 '22 21:09

dirtside


For those looking in 2021, the file is now called handlers.json.

See: https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file

like image 45
elig Avatar answered Sep 30 '22 19:09

elig