fix for bug 202817 - clicking on a link that returns a non-trivial mimetype results in download rather than view. p=bz r=blizzard sr=darin

This commit is contained in:
wade%ezri.org 2006-09-14 06:05:24 +00:00
Родитель d879254193
Коммит 8f1078ab58
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -130,21 +130,21 @@ nsBrowserContentListener.prototype =
isPreferred: function(contentType, desiredContentType)
{
// seems like we should be getting this from helper apps or something
switch(contentType) {
case "text/html":
case "text/xul":
case "text/rdf":
case "text/xml":
case "text/css":
case "image/gif":
case "image/jpeg":
case "image/png":
case "text/plain":
case "application/http-index-format":
try {
var catMgr = Components.classes["@mozilla.org/categorymanager;1"]
.getService(Components.interfaces.nsICategoryManager);
var entry = catMgr.getCategoryEntry("Gecko-Content-Viewers",
contentType);
if (entry) {
return true;
}
return false;
} catch (e) {
// XXX propagate failures other than "NS_ERROR_NOT_AVAILABLE"?
// This seems to never get called, so not like it matters....
return false;
}
return false;
},
canHandleContent: function(contentType, isContentPreferred, desiredContentType)
{