Skip to content
LaTale edited this page Dec 16, 2025 · 1 revision

Differences with mozilla/pdf.js

Note

This is a fork of mozilla/pdfjs with three changes:

  1. Export ES modules in both .js and .mjs formats, since nginx's default MIME types do not serve .mjs files as application/javascript.
  2. Downgrade the target browsers for the legacy build to ES6.
  3. Add a typeof check for FinalizationRegistry in pdf.worker.m?js, as it is not supported in older browsers.

Tip

This fork is regularly synced with upstream mozilla/pdfjs and publishes updates when a new version is available.

与 mozilla/pdf.js 的差异

Note

本仓库是 mozilla/pdfjs 的 fork,有三点改动:

  1. 导出 ES 模块时同时提供 .js 与 .mjs,解决 nginx 默认不按 application/javascript 提供 .mjs 的问题。
  2. legacy 构建的目标浏览器降级到 ES6。
  3. 在 pdf.worker.m?js 中为 FinalizationRegistry 增加 typeof 检查,兼容不支持该特性的旧浏览器。

Tip

本仓库会定期与上游 mozilla/pdfjs 同步,有新版本时发布更新。

Clone this wiki locally