Putting 133382 fix back in - doesn't appear to alter Tp times.

git-svn-id: svn://10.0.0.236/trunk@117757 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tor%cs.brown.edu
2002-03-31 02:12:51 +00:00
parent a666703214
commit 5434ff0201

View File

@@ -170,6 +170,11 @@ nsBrowserStatusHandler.prototype =
this.statusTextField.label = text;
},
mimeTypeIsTextBased : function(contentType)
{
return /^text\/|\+xml$/.test(contentType);
},
onLinkIconAvailable : function(aHref) {
if (gProxyFavIcon && pref.getBoolPref("browser.chrome.site_icons"))
{
@@ -223,7 +228,6 @@ nsBrowserStatusHandler.prototype =
this.stopButton.disabled = false;
this.stopMenu.removeAttribute('disabled');
this.stopContext.removeAttribute('disabled');
this.isImage.removeAttribute('disabled');
// Initialize the progress stuff...
this.useRealProgressFlag = false;
@@ -258,7 +262,9 @@ nsBrowserStatusHandler.prototype =
this.setDefaultStatus(msg);
try {
ctype = aRequest.QueryInterface(nsIChannel).contentType;
if (ctype.match(/^image\//))
if (this.mimeTypeIsTextBased(ctype))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
}
catch (e) {}
@@ -303,6 +309,12 @@ nsBrowserStatusHandler.prototype =
location = "";
}
// Disable menu entries for images, enable otherwise
if (this.mimeTypeIsTextBased(content.document.contentType))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
// We should probably not do this if the value has changed since the user
// searched
// Update urlbar only if a new page was loaded on the primary content area