3 const mime_service = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
5 var mime_type_external_handlers = [
7 [ /^text\/.*$/, getenv("EDITOR")],
8 [/^image\/.*$/, "feh"],
9 [/^video\/.*$/, "mplayer"],
10 [/^audio\/.*$/, "mplayer"],
11 [/^application\/pdf$/, "evince"],
12 [/^application\/postscript$/, "evince"],
13 [/^application\/x-dvi$/, "evince"],
14 [/^.*$/, getenv("EDITOR")]
17 function get_external_handler_for_mime_type(mime_type) {
18 return predicate_alist_match(mime_type_external_handlers, mime_type);
21 function mime_type_from_uri(uri) {
22 var type = "application/octet-stream";
25 type = mime_service.getTypeFromURI(uri);
30 function mime_info_from_mime_type(type) {
32 type = "application/octet-stream";
34 return mime_service.getFromTypeAndExtension(type, null);