W3cubDocs

/Web APIs

Navigator: plugins property

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Returns a PluginArray object, listing the Plugin objects describing the plugins installed in the application. Named properties of the returned object are not enumerable (except in very old browser versions).

Recent versions of the specification hard-code the returned list. If inline viewing of PDF files is supported the property lists five standard plugins. If inline PDF viewing is not supported then an empty list is returned.

Note: Use Navigator.pdfViewerEnabled to determine if inline viewing of PDF files is supported. Do not infer it from this property.

The "five standard plugins" are those that developers have most commonly used to feature detect inline PDF viewing. Returning these ensures that legacy code can more reliably determine whether inline viewing is supported. However this approach is not recommended for new code because this property may eventually be removed.

Legacy browser versions also list plugins for Adobe Flash and PDF viewer extensions.

Value

plugins is a PluginArray object used to access Plugin objects either by name or as a list of items.

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

If PDF inline viewing is supported this will contain entries for the following plugins:

  • "PDF Viewer"
  • "Chrome PDF Viewer"
  • "Chromium PDF Viewer"
  • "Microsoft Edge PDF Viewer"
  • "WebKit built-in PDF"

If inline viewing of PDFs is not supported then an empty object is returned.

Examples

This code shows how to check if PDF files can be displayed inline:

js

if ("PDF Viewer" in navigator.plugins) {
  // browser supports inline viewing of PDF files.
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
plugins 1 12 1 4 ≤12.1 1 4.4 18 4 ≤12.1 1 1.0
returns_plugins 1–94 12–94 1–99 4 ≤12.1–80 1 4.4–94 18–94 4–99 ≤12.1–66 1 1.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/plugins