Open Bug 687386 Opened 13 years ago Updated 2 years ago

Wrong MIME type shown on Mac OS X

Categories

(Firefox :: File Handling, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: limi, Unassigned)

Details

When downloading a file on OS X, you sometimes get MIME type information like "StuffIt Expander" or "wyciwyg resource" (e.g. bug 521918).

__________________________

bz wrote:

In the "Clean up file type mappings" section of http://limi.net/articles/improving-download-behaviors-web-browsers you mention a few things that are not actually precisely Firefox's fault:

1)  The "Stuffit Expander" thing.  That string comes from the OS, not
   from us.
2)  The MP3 thing... again that information about QuickTime comes from
   the OS.

The issue is that OSX has two different sources of MIME information, as far as I can tell, and that the interaction of the two is entirely undocumented.  Sometimes the OS uses one, sometimes the other, sometimes both.  We try to make sense of it as much as we can, but I can readily believe there are cases where we pick the wrong source....

If you have any apple contacts who happen to know how this stuff actually works, I'm all ears.
__________________________

Here's the reply from an Apple engineer:

Here are the selection criteria for LaunchServices, from http://developer.apple.com/mac/library/DOCUMENTATION/Carbon/Conceptual/LaunchServicesConcepts/LSCConcepts/LSCConcepts.html#//apple_ref/doc/uid/TP30000999-CH202-BABBJJEF:

> Preferred Application for a Document
> For individual document files (whether specified by a file-system reference or a URL with scheme file), the criteria are as follows:
>
> 1. If the user has specified an explicit binding for the document (or for the entire document type to which it belongs), the preferred application is the one the user has specified.
> 2. If the document has a filename extension (or if one has been specified as a parameter to LSGetApplicationForInfo), find all applications in the Launch Services database that claim to accept documents with that extension.
> 3. If the document carries a four-character file type (or if one has been specified as a parameter), find all applications that claim to accept files of that type.
> 4. If more than one application has been found as a result of steps 2–3, apply the following criteria in the order shown:
> a. If the document carries a four-character creator signature (or if one has been specified as a parameter), give preference to any application that claims to accept documents with that signature (typically the application to which the signature belongs).
> b. Give preference to native OS X applications over those that run in the Classic emulation environment.
> c. Give preference to applications residing on the boot volume over those residing on other file-system volumes.
> d. Give preference to applications residing on a local volume over those residing on a remote volume.
> e. If two or more versions of the same application have been found, give preference to the one with the latest version number.


I'm betting the reason StuffIt Expander shows up as the owner for a ZIP file is because that's preloaded into Mac OS X's MIME type database as the preferred handler for a ZIP file. But in reality, when you open one, it gets handled by Archive Utility. The LSGetApplicationForItem() and LSGetApplicationForURL() methods should return this information for you.

(It's worth noting that LaunchServices no longer considers the four-character creator code on Snow Leopard and later.)
Ccing some mac folks...
Component: Networking: File → File Handling
QA Contact: networking.file → file-handling
I'm seeing this in Windows 7 with Firefox 12.0.  I have an email that has links to two PDFs.  They open right up in Chrome, but I get the "wyciwyg resource" listed as the type when I download to Firefox.

So this is not isolated to Mac OS X, for what it's worth.
Product: Core → Firefox
Version: Trunk → unspecified
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.