pdfViewerEnabled
The pdfViewerEnabled read-only property of the Navigator 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.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 94 | 94 | 99 | 16.4 | 94 | 16.4 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
if (!navigator.pdfViewerEnabled) {
// The browser does not support inline viewing of PDF files.
} Use cases
-
Using pdfViewerEnabled
The pdfViewerEnabled read-only property of the Navigator interface indicates whether the browser supports inline display of PDF files when navigating to them.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.