This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
The MimeTypeArray
interface returns an array of MimeType
instances, each of which contains information about a supported browser plugins. This object is returned by NavigatorPlugins.mimeTypes
.
Properties
MimeTypeArray.length
- The number of items in the array.
Methods
MimeTypeArray.item()
- Returns the
MimeType
object with the specified index. MimeTypeArray.namedItem()
- Returns the
MimeType
object with the specified name.
Example
The following example tests whether a plugin is available for the application/pdf mime type and if so, which plugin that is.
var mimeTypes = navigator.MimeType;
var flashPlugin = mimeTypes['video/x-flv'];
if (typeof flashPlugin === "undefined") {
var vid = document.createElement('video');
// Use vid.canPlayType() to test for a supported mime type.
} else {
// Notify the user that flash is being deprecated and they
// should upgrade their browser.
}
Specifications
Specification | Status | Comment |
HTML Living StandardThe definition of 'MimeTypeArray' in that specification. | Living Standard | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MimeTypeArray
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support 1 |
IE
? |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 4 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
item
|
Chrome Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Edge
Full support 12 |
Firefox
Full support 1 |
IE
? |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Chrome Android Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Firefox Android
Full support 4 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android Full support 7.0 Full support 7.0 Notes' Prior to Samsung Internet 7.0, method parameters were optional |
length
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support 1 |
IE
? |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 4 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
namedItem
|
Chrome Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Edge
Full support 12 |
Firefox
Full support 1 |
IE
? |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Chrome Android Full support 59 Full support 59 Notes' Prior to version 59, method parameters were optional |
Firefox Android
Full support 4 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android Full support 7.0 Full support 7.0 Notes' Prior to Samsung Internet 7.0, method parameters were optional |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.'
- See implementation notes.
MimeTypeArray by Mozilla Contributors is licensed under CC-BY-SA 2.5.