blob: 3f9c09d768672e56958346a411a521d50cecaacd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
---
title: 测试滕盖
slug: Web/API/NavigatorPlugins/测试滕盖
---
<div>{{ ApiRef("HTML DOM") }}</div>
<div> </div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>Returns a {{domxref("MimeTypeArray")}} object, which contains a list of {{domxref("MimeType")}} 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 <code>MimeTypeArray</code> 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">function isJavaPresent() {
return 'application/x-java-applet' in navigator.mimeTypes;
}
function getJavaPluginDescription() {
var mimetype = navigator.mimeTypes['application/x-java-applet'];
if (mimetype === undefined) {
// no Java plugin present
return undefined;
}
return mimetype.enabledPlugin.description;
}
</pre>
<h2 id="Specification" name="Specification">Specification</h2>
<p><em>This is not part of any specification.</em></p>
|