mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-07 23:43:37 +00:00
bug 133382 r=timeless sr=jag a=asa
find gets enabled in images when used with tabs
This commit is contained in:
parent
2cd5793471
commit
be8b7c7b47
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user