Navigator: pdfViewerEnabled property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2023.
ThepdfViewerEnabled read-only property of theNavigator interface indicates whether the browser supports inline display of PDF files when navigating to them.
If inline viewing is not supported the PDF is downloaded and may then be handled by some external application.
Note:This method replaces a number of legacy methods of inferring support for inline viewing of PDF files.
In this article
Value
true if the browser can display PDF files inline when navigating to the file (using either an internal viewer or a PDF viewer extension); otherwisefalse.
Examples
To check PDF inline viewing support:
js
if (!navigator.pdfViewerEnabled) { // The browser does not support inline viewing of PDF files.}Specifications
| Specification |
|---|
| HTML> # dom-navigator-pdfviewerenabled> |