diff --git a/CHANGELOG.md b/CHANGELOG.md index 8006aa0..169e73e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Remove polyfill for `global.window` which is now redundant + ## 4.2.0 (2024-11-02) - Add a new option called `renderParams`. This allows you to generate transparent images using `renderParams: { background: 'transparent' }` ([#244]) diff --git a/src/index.ts b/src/index.ts index 89c634e..9892ebd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ -import "./polyfill.js"; // do this before pdfjs import { createRequire } from "node:module"; import path from "node:path"; import * as pdfjs from "pdfjs-dist/legacy/build/pdf.mjs"; diff --git a/src/polyfill.ts b/src/polyfill.ts deleted file mode 100644 index 56f348e..0000000 --- a/src/polyfill.ts +++ /dev/null @@ -1,10 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck - -// @ts-expect-error pdfjs references window.xxx, which fails if the jest testEnvironment is node -global.window ||= global; - -// 20ms because that's what pdfjs used to do: https://github.com/mozilla/pdf.js/pull/9138/files -global.window.requestAnimationFrame = (callback) => - global.window.setTimeout(callback, 20); -global.window.cancelAnimationFrame = (id) => global.window.clearTimeout(id);