rem: var channel; try { channel = aRequest.QueryInterface(nsIChannel); } catch(e) { };  if (channel) { var location = channel.URI.spec; 
add: if (aRequest instanceof nsIChannel) { var location = aRequest.URI.spec; 
context:   onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)  {      const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;    const nsIChannel = Components.interfaces.nsIChannel;    var ctype;    if (aStateFlags & nsIWebProgressListener.STATE_START) {      // This (thanks to the filter) is a network start or the first      // stray request (the first request outside of the document load),      // initialize the throbber and his friends.      // Call start document load listeners (only if this is a network load)      if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK &&          aRequest && aWebProgress.DOMWindow == content)        this.startDocumentLoad(aRequest);      // Show the progress meter      this.statusPanel.hidden = false;      // Turn the throbber on.      this.throbberElement.setAttribute("busy", "true");      // XXX: These need to be based on window activity...      this.stopButton.disabled = false;      this.stopMenu.removeAttribute('disabled');      this.stopContext.removeAttribute('disabled');    }    else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {      if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {        if (aRequest) {          if (aWebProgress.DOMWindow == content)            this.endDocumentLoad(aRequest, aStatus);        }      }      // This (thanks to the filter) is a network stop or the last      // request stop outside of loading the document, stop throbbers      // and progress bars and such      if (aRequest) {        var msg = "";        // Get the channel if the request is a channel        var channel;        try {          channel = aRequest.QueryInterface(nsIChannel);        }        catch(e) { };        if (channel) {          var location = channel.URI.spec;          if (location != "about:blank") {            const kErrorBindingAborted = 0x804B0002;            const kErrorNetTimeout = 0x804B000E;            switch (aStatus) {              case kErrorBindingAborted:                msg = gNavigatorBundle.getString("nv_stopped");                break;              case kErrorNetTimeout:                msg = gNavigatorBundle.getString("nv_timeout");                break;            }          }        }        // If msg is false then we did not have an error (channel may have        // been null, in the case of a stray image load).        if (!msg) {          msg = gNavigatorBundle.getString("nv_done");        }        this.status = "";        this.setDefaultStatus(msg);                // Disable menu entries for images, enable otherwise        if (content.document && this.mimeTypeIsTextBased(content.document.contentType))          this.isImage.removeAttribute('disabled');        else          this.isImage.setAttribute('disabled', 'true');      }      // Turn the progress meter and throbber off.      this.statusPanel.hidden = true;      this.statusMeter.value = 0;  // be sure to clear the progress bar      this.throbberElement.removeAttribute("busy");      // XXX: These need to be based on window activity...      // XXXjag: <command id="cmd_stop"/> ?      this.stopButton.disabled = true;      this.stopMenu.setAttribute('disabled', 'true');      this.stopContext.setAttribute('disabled', 'true');    }  },
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/9de24d2dce3f04b72d05e85fe425dbe1b365d294/nsBrowserStatusHandler.js/clean/xpfe/browser/resources/content/nsBrowserStatusHandler.js