Steffen Heinzl wrote:
> Christian Biesinger wrote:
>> Steffen Heinzl wrote:
>>> So, is seems that the content type is already registered (surprise!). Is
>>> there a way to override the text/xml content-type handling of Firefox?
>> Not really... it's probably easiest to write an http-on-modify-request
>> observer and change the content type of the channel in it.
> 
> I thought http-on-modify-request was used to modify the HTTP message
> sent to the HTTP server. Can I really use this to change the
> content-type of the message I receive from the server? Or do I
> misunderstand how this works?
> 
> Thanks again!
I added the following code and everything seems to work fine.

//Observer-object
function Observer() {}

Observer.prototype = {
  observe: function(subject,topic,data){
  subject.QueryInterface(Components.interfaces.nsIChannel);
  if (subject.contentType =="text/xml") subject.contentType = "text/xml2";
  },
  QueryInterface: function(iid) {
        if (!iid.equals(Components.interfaces.nsIObserver))
                throw Components.results.NS_ERROR_NO_INTERFACE;
        return this;
  }
}

Thank you very much. I really appreciate your help.
Steffen
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to