NavigatorPlugins.mimeTypes

  • Revision slug: DOM/window.navigator.mimeTypes
  • Revision title: window.navigator.mimeTypes
  • Revision id: 359339
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{DomRef}}

Summary

Returns a MimeTypeArray object, which contains a list of MimeType objects representing the MIME types recognized by the browser.

Syntax

mimeTypes = navigator.mimeTypes; 

mimeTypes is a MimeTypeArray object which has a length property as well as item(index) and namedItem(name) methods.

Example

alert(window.navigator.mimeTypes.item(0).description); // alerts "Mozilla Default Plug-in"

Notes

The zeroth element in mimeTypes (the "Mozilla Default Plug-in" MimeType object) has a type property of * instead of a typical MIME format like "image/x-macpaint".

Specification

{{DOM0}}

Revision Source

<div>{{DomRef}}</div>


<h2 id="Summary" name="Summary">Summary</h2>
<p>Returns a <a href="http://www.xulplanet.com/references/objref/MimeTypeArray.html"><code>MimeTypeArray</code></a> object, which contains a list of <a href="http://www.xulplanet.com/references/objref/MimeType.html"><code>MimeType</code></a> objects representing the MIME types recognized by the browser.</p>


<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<var>mimeTypes</var> = navigator.mimeTypes; 
</pre>

<p><code>mimeTypes</code> is a <a href="http://www.xulplanet.com/references/objref/MimeTypeArray.html"><code>MimeTypeArray</code></a> object which has a <code>length</code> property as well as <code>item(index)</code> and <code>namedItem(name)</code> methods.</p>


<h2 id="Example" name="Example">Example</h2>

<pre class="brush:js">
alert(window.navigator.mimeTypes.item(0).description); // alerts "Mozilla Default Plug-in"
</pre>


<h2 id="Notes" name="Notes">Notes</h2>
<p>The zeroth element in mimeTypes (the "Mozilla Default Plug-in" <code>MimeType</code> object) has a <code>type</code> property of <code>*</code> instead of a typical MIME format like "<code>image/x-macpaint</code>".</p>


<h2 id="Specification" name="Specification">Specification</h2>
<p>{{DOM0}}</p>
Revert to this revision