MimeTypeArray

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support 1IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support 4Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
itemChrome Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge ? Firefox Full support 1IE ? Opera Full support YesSafari ? WebView Android Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Chrome Android Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge Mobile ? Firefox Android Full support 4Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
lengthChrome Full support YesEdge ? Firefox Full support 1IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support 4Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
namedItemChrome Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge ? Firefox Full support 1IE ? Opera Full support YesSafari ? WebView Android Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Chrome Android Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge Mobile ? Firefox Android Full support 4Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

Document Tags and Contributors

Contributors to this page: fscholz, jpmedley
Last updated by: fscholz,