rem: try { var url = this.uri.QueryInterface(Components.interfaces.nsIURL); var ext = url.fileExtension; if (ext) { var mimeInfo = getMIMEInfoForExtension(ext); if (mimeInfo) this.contentType = mimeInfo.MIMEType; } } catch (e) {  } 
add: var type = getMIMETypeForURI(this.uri); if (type) this.contentType = type; 
context:   onStopRequest: function (aRequest, aContext, aStatus) {    try {      if (aStatus == 0) { // NS_BINDING_SUCCEEDED, so there's something there        var linkChecker = aRequest.QueryInterface(Components.interfaces.nsIURIChecker);        var channel = linkChecker.baseChannel;        this.contentType = channel.contentType;        try {          var httpChannel = channel.QueryInterface(Components.interfaces.nsIHttpChannel);          var encodedChannel = channel.QueryInterface(Components.interfaces.nsIEncodedChannel);          this.contentEncodingType = null;          // There may be content-encodings on the channel.  Multiple content          // encodings are allowed, eg "Content-Encoding: gzip, uuencode".  This          // header would mean that the content was first gzipped and then          // uuencoded.  The encoding enumerator returns MIME types          // corresponding to each encoding starting from the end, so the first          // thing it returns corresponds to the outermost encoding.          var encodingEnumerator = encodedChannel.contentEncodings;          if (encodingEnumerator && encodingEnumerator.hasMoreElements()) {            try {              this.contentEncodingType =                encodingEnumerator.getNext().                  QueryInterface(Components.interfaces.nsISupportsCString).data;            } catch (e) {            }          }          this.mContentDisposition = httpChannel.getResponseHeader("content-disposition");        }        catch (e) {        }        if (!this.contentType || this.contentType == "application/x-unknown-content-type") {          // We didn't get a type from the server.  Fall back on other type detection mechanisms          throw "Unknown Type";        }      }      else {        dump("Error saving link aStatus = 0x" + aStatus.toString(16) + "\n");        var bundle = getStringBundle();        var errorTitle = bundle.GetStringFromName("saveLinkErrorTitle");        var errorMsg = bundle.GetStringFromName("saveLinkErrorMsg");        const promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);        promptService.alert(this.mData.window, errorTitle, errorMsg);        return;      }    }    catch (e) {      if (this.mData.document) {        this.contentType = this.mData.document.contentType;      } else {        try {          var url = this.uri.QueryInterface(Components.interfaces.nsIURL);          var ext = url.fileExtension;          if (ext) {            var mimeInfo = getMIMEInfoForExtension(ext);            if (mimeInfo)              this.contentType = mimeInfo.MIMEType;          }        }        catch (e) {          // Not much we can do here.  Give up.        }      }    }    this.mCallback(this, this.mData, this.mSkipPrompt);  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/89aa5f173262c61b693d5d4f123b6344a03e6fdb/contentAreaUtils.js/clean/browser/base/content/contentAreaUtils.js