James Newell wrote:
> Hi,
> 
> I would like to create a new resource (for the resource:// protocol)
> globally across XULRunner application. I have tried using
> setSubstitution() on a new instance of nsIResProtocolHandler but
> obviously this is not too successful.

The resource protocol handler should be a singleton service. Please ask the
IO service for getProtocolHandler("resource"), QI that to
nsIResProtocolHandler, and then call setSubstitution(). However, there is a
better way, assuming that your resource: maps to a directory location:

If you want to register for the resource://myfoo/ mappping, you can simply
register a directory service provider for the "resource:myfoo" key: the
resource protocol handler will automatically ask the directory service for
that key and set up the substitution correctly.

--BDS
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to