Open Bug 1721181 Opened 4 years ago Updated 4 years ago

[macOS, android] mime service's getFromTypeAndExtension does not set primary extension for unknown mimetypes

Categories

(Firefox :: File Handling, defect, P3)

All
Unspecified
defect

Tracking

()

Tracking Status
firefox92 --- affected

People

(Reporter: Gijs, Unassigned)

References

Details

STR:

  1. Run this in a browser console:
mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
mimeService.getFromTypeAndExtension("application/x-asfgsdfgsdfgsdfgfds", ".something").primaryExtension

ER:

.something

AR:

Uncaught Exception { name: "NS_ERROR_NOT_INITIALIZED", message: "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMIMEInfo.primaryExtension]", result: 3253927937, filename: "debugger eval code", }

Windows and Linux do set the primary extension.

Update: in addition to macOS, android also does not set the primary extension.

OS: macOS → Unspecified
Hardware: Desktop → All
Summary: [macOS] mime service's getFromTypeAndExtension does not set primary extension for unknown mimetypes → [macOS, android] mime service's getFromTypeAndExtension does not set primary extension for unknown mimetypes
Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.