Skip to content

docs: document URL.parse requirement and polyfill for Chrome <126 and Safari <18 - #2146

Merged
wojtekmaj merged 2 commits into
wojtekmaj:mainfrom
mikev-lab:docs/url-parse-polyfill
Sep 21, 2026
Merged

wojtekmaj merged 2 commits into
wojtekmaj:mainfrom
mikev-lab:docs/url-parse-polyfill

Conversation

@mikev-lab

Copy link
Copy Markdown
Contributor

Summary

Modern versions of pdfjs-dist utilize the WHATWG static method URL.parse() (Baseline 2024). While the browser support section currently notes Chrome 125 as a minimum, URL.parse() was only introduced in Chrome 126 and Safari 18.

In environments running Chrome <126 (e.g. Chrome 122–125), Safari <18, or older embedded mobile webviews, this causes an unhandled TypeError: URL.parse is not a function during viewer initialization.

Changes

  • Added a ##### Polyfilling URL.parse subsection under Compatibility -> Browser support.
  • Documented the runtime versions where URL.parse is natively available (Chrome 126+, Safari 18+, Node 22.1.0+).
  • Provided the standard WHATWG-compliant non-throwing polyfill snippet for developers needing to support those environments.

@wojtekmaj wojtekmaj left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@wojtekmaj
wojtekmaj enabled auto-merge (squash) September 21, 2026 10:21
@wojtekmaj
wojtekmaj merged commit 585ee1e into wojtekmaj:main Sep 21, 2026
4 checks passed
wojtekmaj added a commit that referenced this pull request Sep 21, 2026
…i <18 (#2146)

Co-authored-by: Wojciech Maj <kontakt@wojtekmaj.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants