diff --git a/mozilla/suite/browser/nsBrowserStatusHandler.js b/mozilla/suite/browser/nsBrowserStatusHandler.js index d7381971202..cc9c266a364 100644 --- a/mozilla/suite/browser/nsBrowserStatusHandler.js +++ b/mozilla/suite/browser/nsBrowserStatusHandler.js @@ -82,6 +82,8 @@ nsBrowserStatusHandler.prototype = hideAboutBlank : true, + locationChanged : false, + QueryInterface : function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || @@ -225,6 +227,8 @@ nsBrowserStatusHandler.prototype = this.stopButton.disabled = false; this.stopMenu.removeAttribute('disabled'); this.stopContext.removeAttribute('disabled'); + + this.locationChanged = false; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { @@ -273,7 +277,12 @@ nsBrowserStatusHandler.prototype = } this.status = ""; this.setDefaultStatus(msg); - if (channel) { + + //if the location hasn't been changed, the document may be null(eg a full-page plugin), + //we may not be able to get the correct content-type. + //so we need to skip the test and keep the menu status. + //otherwise(this.locationChanged = true), test normally. + if (channel && this.locationChanged) { try { ctype = channel.contentType; if (this.mimeTypeIsTextBased(ctype)) @@ -336,6 +345,8 @@ nsBrowserStatusHandler.prototype = SetPageProxyState("valid", aLocation); } UpdateBackForwardButtons(); + + this.locationChanged = true; }, onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)