Dmitry Dartz <[EMAIL PROTECTED]> wrote: > Suppose I have custom sources for some html, css, js and images that > I can't save to the files, and I want mozilla browser to use them as > memory streams. Is there a way to intercept URLs/URIs activity and > provide my own streams with content I have? What interfaces/listeners > to check? Any ideas?
You can register a protocol handler for a custom protocol (as in, myproto://anything) . You create an XPCOM component implementing nsIProtocolHandler, and register it under the contractid of "@mozilla.org/network/protocol;1?name=myproto". The real work happens in nsIProtocolHandler::NewChannel where you need to create and return an nsIChannel implementation given a URL. Probably the easiest way is to use nsIInputStreamChannel component, which is a channel that gets its data from a stream (specifically nsIInputStream). Igor Tandetnik _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
