I – being a developer – like to send patches (“.patch” files) using GMail to a mailinglist. My peers will want to read these patches, and thus I’d like to associate a content-type (or mime-type, or file-type) with these patches so that in email clients, it’ll be opened in a text editor, or GMail with show a “View” link. The normal content-type for this is text/plain, so in past versions of Firefox, I used the MacOSX MisFox preferences pane to add a content-type “text/plain” for files with the extension “.patch”. Worked great.
However, this stopped working after an upgrade of Firefox. I used to send emails with an attached “.patch” file, and GMail would show a “View” link. In my current Firefox, this “View” link is still there for old emails. However, when I send new emails with “.patch” files attached, the “View” link is not there. It seems that while sending emails, my Firefox misdetects “.patch” files for something else. My only available action is “Download”, which (when pressed) tells me it is not a “text/plain” file, but a “Patch file”.
This name “Patch file” occurs in the Firefox “Preferences -> Applications” window, for “text/x-diff” and “text/x-patch” files. Clients on the other side of my emails, including GMail and patch reviewers, do not know these content-types and can thus not auto-view my patches in their email client. How do I permanently get rid of this content-type association in Firefox?
[edit, 1 day later] I looked at mimeTypes.rdf, and I adapted what I could so that “.patch” is now recognized as “text/plain” on downloads, but uploads still fail to display a “View” link for “.patch” files, whereas “.txt” files display the “View” link just fine. Are uploads independent of mimeTypes.rdf? [/edit]
[edit:2] From similar tests in Safari, I see the same problem. All descriptions of this problem in previous versions of Firefox are browser-specific. In other words, this might not be a Firefox-problem, it appears like Google is changing the content-type of uploads server-side. Why? [/edit]