diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js index 67ea8d43fdc..875c5926d49 100644 --- a/suite/browser/navigator.js +++ b/suite/browser/navigator.js @@ -404,9 +404,7 @@ function Shutdown() browser.boxObject.removeProperty("listenerkungfu"); try { - var interfaceRequestor = browser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor); - var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress); - webProgress.removeProgressListener(window.XULBrowserWindow); + getBrowser().removeProgressListener(window.XULBrowserWindow); } catch (ex) { } diff --git a/suite/browser/nsBrowserStatusHandler.js b/suite/browser/nsBrowserStatusHandler.js index 52d99ce85ae..4a8d54698d4 100644 --- a/suite/browser/nsBrowserStatusHandler.js +++ b/suite/browser/nsBrowserStatusHandler.js @@ -147,10 +147,7 @@ nsBrowserStatusHandler.prototype = }, onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) - { - if (!aRequest) - return; - + { //ignore local/resource:/chrome: files if (aStatus == NS_NET_STATUS_READ_FROM || aStatus == NS_NET_STATUS_WROTE_TO) return; @@ -164,7 +161,7 @@ nsBrowserStatusHandler.prototype = this.startTime = (new Date()).getTime(); domWindow = aWebProgress.DOMWindow; - if (domWindow == _content) + if (aRequest && domWindow == _content) this.startDocumentLoad(aRequest); // Turn progress meter on. @@ -194,19 +191,21 @@ nsBrowserStatusHandler.prototype = } if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { domWindow = aWebProgress.DOMWindow; - if (domWindow == domWindow.top) - this.endDocumentLoad(aRequest, aStatus); + if (aRequest) { + if (domWindow == domWindow.top) + this.endDocumentLoad(aRequest, aStatus); - var location = aRequest.QueryInterface(nsIChannel).URI.spec; - var msg = ""; - if (location != "about:blank") { - // Record page loading time. - var elapsed = ((new Date()).getTime() - this.startTime) / 1000; - msg = gNavigatorBundle.getString("nv_done"); - msg = msg.replace(/%elapsed%/, elapsed); + var location = aRequest.QueryInterface(nsIChannel).URI.spec; + var msg = ""; + if (location != "about:blank") { + // Record page loading time. + var elapsed = ((new Date()).getTime() - this.startTime) / 1000; + msg = gNavigatorBundle.getString("nv_done"); + msg = msg.replace(/%elapsed%/, elapsed); + } + this.status = ""; + this.setDefaultStatus(msg); } - this.status = ""; - this.setDefaultStatus(msg); // Turn progress meter off. this.statusMeter.mode = "normal";