Hello,
Christian Biesinger wrote:
Charles Iliya Krempeaux wrote:
What I'd like to do now is to replace the "content" of an HTTP
response. (I though I'd be able to do this through the
nsIChannel.open method... but when I call that I get an exception.
So, I guess I'm doing it wrong.)
I think what you have to do is add an "http-on-examine-response"
observer, change the content type of the channel to something special,
and implement a stream converter for that special content type.
I'm guessing the "stream converter" looks something like:
function MyStreamConverter()
{
// Nothing here.
}
MyConverter.prototype =
{ asyncConvertData: function(fromType,toType,stream_listener,ctxt)
{
// #### TODO
}
, convert: function(from_input_stream,fromType,toType,ctxt)
{
// #### TODO
}
};
But how do I register this?
Over on this page...
http://www.xulplanet.com/references/xpcomref/ifaces/nsIStreamConverter.html
... it says is:
Stream converter registration is a two step process. First of
all the stream converter implementation must register itself
with the component manager using a contractid in the format
below. Second, the stream converter must add the contractid to
the registry.
Stream converter contractid format (the stream converter root key
is defined in this file):
@mozilla.org/streamconv;1?from=FROM_MIME_TYPE&to=TO_MIME_TYPE
But I don't know how to go about doing this registration. Any suggestions?
TIA
See ya
--
Charles Iliya Krempeaux, B.Sc.
charles @ reptile.ca
supercanadian @ gmail.com
developer weblog: http://ChangeLog.ca/
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding