Skip to content

Fix PDF viewer crash on older browsers#31

Merged
jdmcleod merged 2 commits intomainfrom
fix/url-parse-polyfill
Mar 20, 2026
Merged

Fix PDF viewer crash on older browsers#31
jdmcleod merged 2 commits intomainfrom
fix/url-parse-polyfill

Conversation

@jdmcleod
Copy link
Copy Markdown
Collaborator

@jdmcleod jdmcleod commented Mar 20, 2026

Summary

  • Adds a URL.parse polyfill for browsers that don't support it (Safari < 18.2, Chrome < 126)
  • pdfjs-dist v5 uses URL.parse() internally, which causes an "Unable to Load PDF" error on older browsers
  • The polyfill shims URL.parse using new URL() with try/catch, matching the spec behavior

Test plan

  • Delete URL.parse in browser console, reload PDF viewer, confirm PDF loads
  • Verify PDF viewer works normally on a supported browser

🤖 Generated with Claude Code

jdmcleod and others added 2 commits March 20, 2026 10:35
pdfjs-dist v5 uses URL.parse() which is unavailable in older browsers
(Safari < 18.2, Chrome < 126), causing "Unable to Load PDF" errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jdmcleod jdmcleod merged commit f7f78e1 into main Mar 20, 2026
1 check passed
@jdmcleod jdmcleod deleted the fix/url-parse-polyfill branch March 20, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants