This is an experimental technology
Check 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 Standard The 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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MimeTypeArray | Chrome Full support Yes | Edge Full support ≤18 | 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
| Edge Full support 12 | Firefox Full support 1 | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android
Full support
59
| Chrome Android
Full support
59
| Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android
Full support
7.0
|
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
| Edge Full support 12 | Firefox Full support 1 | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android
Full support
59
| Chrome Android
Full support
59
| Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android
Full support
7.0
|
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.
- See implementation notes.