From f0ea19744a51b5c8207dfdaba11b22b5b7051afd Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Thu, 14 Sep 2006 05:59:41 +0000 Subject: [PATCH] More 100706 fun. r/sr=jst,jag --- suite/browser/navigator.js | 4 +--- suite/browser/nsBrowserStatusHandler.js | 31 ++++++++++++------------- 2 files changed, 16 insertions(+), 19 deletions(-) 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";