-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop exposing the URL
polyfill in the global scope
#9868
Conversation
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/4506105370e662a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/4506105370e662a/output.txt Total script time: 8.11 mins Published |
This moves/exposes the `URL` polyfill similarily to the existing `ReadableStream` polyfill, rather than exposing it globally, to avoid interfering with any "outside" code. Both the `URL` and `ReadableStream` polyfills are now exposed on the `pdfjsLib` object, such that they are accessible to the viewer components. Furthermore, the `no-restricted-globals` ESLint rule is also enabled to prevent accidental usage of the native `URL`/`ReadableStream` implementations directly in the `src/` and `web/` folders; see also https://eslint.org/docs/rules/no-restricted-globals Addresses the remaining TODO in https://github.com/mozilla/pdf.js/projects/6
0455537
to
a9ce4e8
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/380e76e348e4a2f/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/380e76e348e4a2f/output.txt Total script time: 7.70 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/488ec3ed977e84a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/9b0807b4ae001a1/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/9b0807b4ae001a1/output.txt Total script time: 24.03 mins
|
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/488ec3ed977e84a/output.txt Total script time: 37.51 mins
|
Nice work! It's good to not change the global scope anymore with the |
Stop exposing the `URL` polyfill in the global scope
This moves/exposes the
URL
polyfill similarily to the existingReadableStream
polyfill, rather than exposing it globally, to avoid interfering with any "outside" code.Both the
URL
andReadableStream
polyfills are now exposed on thepdfjsLib
object, such that they are accessible to the viewer components.Furthermore, the
no-restricted-globals
ESLint rule is also enabled to prevent accidental usage of the nativeURL
/ReadableStream
implementations directly in thesrc/
andweb/
folders; see also https://eslint.org/docs/rules/no-restricted-globalsAddresses the remaining TODO in https://github.com/mozilla/pdf.js/projects/6
By not exposing the polyfilled
URL
globally, the PR might also "fix" issues #8726 and #9358 for free./cc @yurydelendik