Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Navigator
  4. plugins

Navigator: plugins property

Returns aPluginArray object, listing thePlugin 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:UseNavigator.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 aPluginArray object used to accessPlugin objects either by name or as a list of items.

The returned value is not a JavaScript array, but has thelength property and supports accessing individual items using bracket notation (plugins[2]), as well as viaitem(index) andnamedItem("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

Specification
HTML
# dom-navigator-plugins

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp