← Home🐞
📄

PDF Viewer 2

Opens a PDF via WTN.openPDF()

✅
Sample PDF
Public document
🔒
Protected PDF
Served via Google Drive
✅
New Drive PDF
Served via Google Drive
✏️

Custom PDF

Provide any URL & title

📋

Call Log

Result of each Pdfopen call

No calls yet.
🔗

Link Detection

Auto-route in-page links to the PDF viewer

Auto-detect PDF links
Intercepts <a> tags pointing to ".pdf" URLs.

Comma-separated. Any link containing one of these always opens in the PDF viewer, even without a ".pdf" extension.

⚠️

No-extension / No-link PDF

Tests native-level URL pattern interception (bypasses this page's JS entirely)

The "Live demo" links above are only caught because this page listens for <a> clicks in JavaScript. A real generated-PDF URL (no ".pdf" extension, no anchor tag β€” e.g. triggered by a redirect or a button that sets window.location.href) never passes through that listener. The only thing that can catch it is the app's native "URL patterns" setting matching the navigation itself. Set a pattern there that matches the URL below (e.g. drive.usercontent), reload the app, then use a button here. If interception works, the PDF viewer opens and you stay in the app. If it doesn't, the webview will actually navigate away to the raw file/download.

Defaults to generated-invoice β€” a real PDF file in this repo hosted with no extension, resolved relative to wherever this page is deployed. Swap in the Drive link or your own generated-PDF endpoint if you'd rather test that.

window.location.href = url
Full top-level navigation, no <a> element involved
window.open(url, '_self')
Same-tab open call, still no anchor tag
Hidden form submit (GET)
Navigation via form submission, not a link click
📦

Large PDF

Test the loading state on a slow-to-open file

📚
Federal Register β€” full issue
~16.3 MB · public, no auth

Opens via the same Pdfopen() call. The button shows a loading state until the native viewer hands control back (visibilitychange) or after an 8s fallback timeout.