Andre Pang started a thread a few weeks back that touched on something
with which I've been fighting.

I'm working on an extension that handles files of MIME type
'application/x-foo' (with most files of this type being of extension
'foo').  If a user clicks on a link to a file that gets served as this
MIME type, the extension gets invoked.  However, if the web server
doesn't serve the file as this MIME type, the extension does not get
invoked.  All of which is expected.  But I wanted to handle these as
well.

So I dug around for far too long trying to figure out how to register
the extension as a helper app-- no luck.  But I did run across the
posts in the Andre Pang thread ("Launching chromes via
nsIContentHandler").

So, following the advice in that thread (I think), I've used
nsICategoryManager to link '.foo' to 'application/x-foo'.  Cribbing off
of what Moz does in nsExternalHelperAppService.cpp, I've checked to be
sure that

Components.classes['@mozilla.org/categorymanager;1'].getService(Components.interfaces.nsICategoryManager).getCategoryEntry('ext-to-type-mapping','foo')

comes back with 'application/x-foo'.  It does.

Yet still, when I click on a file of type .foo from a server that
doesn't serve it as MIME type 'application/x-foo', Firefox asks what to
do with it rather than invoking the extension.

Am I doing something wrong?

_______________________________________________
Mozilla-netlib mailing list
Mozilla-netlib@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to