Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How do I programatically add a download action to firefox desktop as part of my application install (like http://mzl.la/NxCODA but from code).

  • 2 回覆
  • 3 有這個問題
  • 3 次檢視
  • 最近回覆由 patpiccolo

more options

I have a Windows application that is intended to work with a specific MIME type. I need to register that MIME type and tell FireFox that when it receives content with this MIME type to NOT display the Open/Save dialog, and instead just pass the stream on to my application, much the same way iTunes registers application/x-itunes-itlp to automatically open iTunes

I have a Windows application that is intended to work with a specific MIME type. I need to register that MIME type and tell FireFox that when it receives content with this MIME type to NOT display the Open/Save dialog, and instead just pass the stream on to my application, much the same way iTunes registers application/x-itunes-itlp to automatically open iTunes

所有回覆 (2)

more options

That would require to add this MIME type to the mimeTypes.rdf file.

If this application is set as the default program for this MIME type and file extension (HKEY_CLASSES_ROOT) then Firefox should offer it automatically as the first choice and users should only need to tick the box to do automatically use this choice.

more options

Thanks cor-el. The documentation here: http://kb.mozillazine.org/MimeTypes.rdf implies my only options are

a) Allow Firefox (via the UI) to make the changes to the file

b) Take the much more risky approach of editing the file manually.

Yes, I can certainly crack open the mimetype.rdf from code, but the reality is, that is a proprietary file whose structure and use is wholly controlled by mozilla. I would much rather prefer an API that I can at least be involved in notification when its changing instead of just waking up one day and the structure and use of the file is changed.

Since mimetype.rdf doesn't have a version number... how do I know that the changes I'd make today for FireFox 23 to support my custom mimetype work when FireFox 30 comes out? If access to that file was through an API I wouldn't care if FireFox 30 uses a database instead of an RDF file... my code would still work. Does such an API exist, or am I stuck with hacking at the mimetype.rdf