Adding support for a new file type in Firefox

Discuss building things with or for the Mozilla Platform.
Post Reply
marks87
Posts: 1
Joined: April 8th, 2009, 1:45 pm

Adding support for a new file type in Firefox

Post by marks87 »

Hi,

I'm currently working with a new format for data exchange (let's called it "ABC", just for argument's sake), which is a type of RDF.

I've implemented an XML stylesheet that allows this type to be viewed as XHTML in a web browser and this works perfectly when using server-side processing to prefix the stylesheet import to the top of ".abc" files.

However, what I'd really like to do is provide a method for Firefox (and, in the long run, other browsers) to be able to render these files themselves. So my aim would be to have the XSLT bundled into Firefox, and some form of handler that looks for the MIME type "text/ABC", or the file extension .abc, and the file rendered using the XSLT.

Can anyone give me any pointers as to where I could start with this?

Thanks.
Torisugari
Posts: 1634
Joined: November 4th, 2002, 8:34 pm
Location: Kyoto, Nippon (GMT +9)
Contact:

Re: Adding support for a new file type in Firefox

Post by Torisugari »

One reasonable way to do that is to write a stream converter
http://mxr.mozilla.org/mozilla/source/n ... verter.idl
and register it as something like
@mozilla.org/streamconv;1?from=text/abc&to=application/xhtml+xml
and in NS_ISTREAMCONVERTER_KEY category.

Otherwise, "Gecko-Content-Viewers" category.
Japanac033
Posts: 6
Joined: April 30th, 2009, 4:04 pm
Contact:

Re: Adding support for a new file type in Firefox

Post by Japanac033 »

Interesting topic. Even if Firefox provides this method, it is very questionable when and if the others would follo; as you pointed out yourself.

I will look deeper into it if there is an alternative and I'll come back here.

Till then... I suppose you are stuck with xhtml
Post Reply