I'm using nsIContentHandler in Mozilla to try and deal with WML
content, but am unsure of the details of how some things are working.

Based on some of the Chatzilla code, I am creating a content handler
for content of type text/vnd.wap.wml, and registering the component so
that it deals with the content. (This is working correctly.)

In handleContent, I have the parameters aContentType, aCommand,
aWindowTarget, and aRequest. Following Chatzilla's example, I get the
URL requested by QI'ing the request to a channel, and getting
channel.URI.spec. I then do an XMLHTTPRequest to get the WML content
before transforming it for viewing, and displaying this in a new
window.

My questions are:

1. Can I use aWindowTarget to display the results in the correct
window? Would I do a QueryInterface on it to get some kind of window
object? If so, which interface would I use?

2. Presumably, by the time handleContent is called, the request has
already been made to the server and the response has been received (or
has started to be received) - otherwise how would Mozilla know the
content type. So my XMLHTTPRequest to get the content is redundant. Is
there any way to get access to the rest of the response from the
server? Or am I misunderstanding the architecture here?

Thanks,

Matthew

Reply via email to