MimeTypeArray

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

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 AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
MimeTypeArrayChrome Full support YesEdge Full support YesFirefox Full support 1IE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
itemChrome Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge Full support 12Firefox Full support 1IE ? Opera Full support YesSafari Full support YesWebView 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
Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
lengthChrome Full support YesEdge Full support 12Firefox Full support 1IE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
namedItemChrome Full support 59
Notes
Full support 59
Notes
Notes Prior to version 59, method parameters were optional
Edge Full support 12Firefox Full support 1IE ? Opera Full support YesSafari Full support YesWebView 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
Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

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