Skip to content

Commit

Permalink
Stop exposing the URL polyfill in the global scope
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Snuffleupagus committed Jul 4, 2018
1 parent 42922c9 commit a9ce4e8
Show file tree
Hide file tree
Showing 17 changed files with 736 additions and 671 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"no-catch-shadow": "error",
"no-delete-var": "error",
"no-label-var": "error",
"no-restricted-globals": "off",
"no-shadow-restricted-names": "error",
"no-shadow": "off",
"no-undef-init": "error",
Expand Down
Loading

0 comments on commit a9ce4e8

Please sign in to comment.