On 21/01/2005, at 9:32 AM, Christian Biesinger wrote:

OK, I don't really mind how it gets done (whether by nsIContentHandler,
nsIURIContentListener, etc), as long as I can do it :). One
interesting thing is that I actually did get this working using a
nsIProtocolHandler

Actually, now that you mention it :-) You could implement nsIContentHandler, and in handleContent open a new window. Prefix the URL with x-foo or whatever to trigger your protocol handler. You can use the "chrome" flag for openWindow to avoid wrapping it with a normal browser window, or you can just pass the flag to hide the location bar (I'm not sure what it's called currently) (This would be to avoid showing the location bar, I seem to recall that you wanted this)

Ah, I think there's a slight misunderstanding here: the thing is that I don't want a separate window to open up (which is how most of the content handlers that I had a look at work; e.g. Venkman, Chatzilla). I'd like the content to appear in the same browser window that the user typed the http://www.example.com/data.foo URL, i.e. I'm trying to look like a plugin. From a webpage author's point of view, I kind of want to "redirect" <http://example.com/data.foo> to <chrome://fooview/content/fooview.xul?http://example.com/data.foo>, but still have the location bar to still display the original <http://example.com/data.foo> URL.


Thanks for all your help so far, Christian. It's greatly appreciated -- trying to understand how docshell + nsIContent{Handler,Listener} all work together is quite a headspin!


-- % Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/> _______________________________________________ Mozilla-netlib mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to