NavigatorPlugins.plugins

  • Revision slug: DOM/window.navigator.plugins
  • Revision title: window.navigator.plugins
  • Revision id: 364273
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment Code( .bold() method is too old ), CleanUp.

Revision Content

{{DomRef}}

Summary

Returns a {{domxref("PluginArray")}} object, listing the plugins installed in the application.

Syntax

plugins = navigator.plugins;

plugins is a PluginArray, containing {{domxref("Plugin")}} objects for the installed plugins.

The returned value is not a JavaScript array, but has the length property and supports accessing individual items using bracket notation (plugins{{mediawiki.external(2)}}), as well as via item(index) and namedItem("name") methods.

Example

The following example prints out information about the installed plugin(s) for the high-level document. Note the properties available on the Plugin object: name, filename, description, and version.

{{gecko_minversion_note("1.9.2", "The version property was added in Gecko 1.9.2.")}}
var L = navigator.plugins.length;

document.write( L.toString() + " Plugin(s)" );
document.write( "<br>" );
document.write( "Name | Filename | description" );
document.write( "<br>" );

for(var i = 0; i < L; i++) {
  document.write( navigator.plugins[i].name );
  document.write( " | " );
  document.write( navigator.plugins[i].filename );
  document.write(" | ");
  document.write( navigator.plugins[i].description );
  document.write( " | " );
  document.write( navigator.plugins[i].version );
  document.write( "<br>" );
}

Notes

The {{domxref("Plugin")}} object exposes a small interface for getting information about the various plugins installed in your browser. A list of plugins is also available by entering about:plugins in the browser's Location bar.

Specification

{{DOM0}}

Revision Source

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


<h2 id="Summary" name="Summary">Summary</h2>
<p>Returns a {{domxref("PluginArray")}} object, listing the plugins installed in the application.</p>


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

<pre class="syntaxbox">
<var>plugins</var> = navigator.plugins;
</pre>


<p><code>plugins</code> is a <code>PluginArray</code>, containing {{domxref("Plugin")}} objects for the installed plugins.</p>

<p>The returned value is not a JavaScript array, but has the <code>length</code> property and supports accessing individual items using bracket notation (<code>plugins{{mediawiki.external(2)}}</code>), as well as via <code>item(<var>index</var>)</code> and <code>namedItem(<em>"name"</em>)</code> methods.</p>


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

<p>The following example prints out information about the installed plugin(s) for the high-level document. Note the properties available on the Plugin object: <code>name</code>, <code>filename</code>, <code>description</code>, and <code>version</code>.</p>

<div>{{gecko_minversion_note("1.9.2", "The <code>version</code> property was added in Gecko 1.9.2.")}}</div>

<pre class="brush:js">
var L = navigator.plugins.length;

document.write( L.toString() + " Plugin(s)" );
document.write( "&lt;br&gt;" );
document.write( "Name | Filename | description" );
document.write( "&lt;br&gt;" );

for(var i = 0; i &lt; L; i++) {
  document.write( navigator.plugins[i].name );
  document.write( " | " );
  document.write( navigator.plugins[i].filename );
  document.write(" | ");
  document.write( navigator.plugins[i].description );
  document.write( " | " );
  document.write( navigator.plugins[i].version );
  document.write( "&lt;br&gt;" );
}
</pre>


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

<p>The {{domxref("Plugin")}} object exposes a small interface for getting information about the various plugins installed in your browser. A list of plugins is also available by entering <code>about:plugins</code> in the browser's Location bar.</p>


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