> I implemented a nsIContentHandler component which works fine, but i don't see > how to get the response data. > When the handleContent method is invoked, i get the nsIRequest as a parameter > that i queryinterface to a nsIChannel. > I would like to use an nsIStreamListener to capture data asynchronously, but > if i do an asyncOpen on the channel, i get the > error NS_ERROR_IN_PROGRESS, which makes sense as the channel has already been > opened. > > The only solution i can see so far is to cancel the current request and > perform another on my own to the same uri, but > that looks a little bit dirty and i tend to think that there is a better way > to get content from a content handler.
With nsIContentHandler that is indeed the only thing you can do. If you want to get the actual data, implement nsIURIContentListener instead - with that, you can return a stream listener that receives the data. -christian _______________________________________________ dev-tech-network mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-network
