Commit Graph

291 Commits

Author SHA1 Message Date
Jonas Jenwald
07ba352903 Update npm packages 2023-01-28 08:13:13 +01:00
Jonas Jenwald
32357e3d17 Update rimraf to version 4
The primary change is that the `rimraf` function now returns a Promise instead of taking a callback; please see https://github.com/isaacs/rimraf#major-changes-from-v3-to-v4
2023-01-15 15:38:30 +01:00
Calixte Denizet
685b5866e4 Remove shadow around each pages (fix issue #15836) 2023-01-02 14:58:53 +01:00
Jonas Jenwald
492ce090bd Update npm packages 2022-12-25 12:59:34 +01:00
Calixte Denizet
f19572c4cc [GV] Add a viewer for GeckoView 2022-12-15 13:39:48 +01:00
Jonas Jenwald
fbcc20adb7 Update npm packages 2022-11-13 21:28:21 +01:00
Takashi Tamura
0bb478cb23 Move canvas to optionalDependencies, which enables npm to continue installing pdfjs-dist
even if the installation of canvas fails. Close #15652
2022-11-02 08:33:31 +09:00
Jonas Jenwald
c894be92fb Replace the DOMMatrix polyfill, used with Node.js, with the one from node-canvas
Fewer dependencies shouldn't be a bad idea in general, and given that the `node-canvas` package already include a `DOMMatrix` polyfill we can simply use that one instead.
2022-09-27 12:12:50 +02:00
Tim van der Meij
d78619cd66
Merge pull request #15452 from Snuffleupagus/chrome-extension
Temporarily stop listing the official Chrome extension in the main README
2022-09-18 14:29:46 +02:00
Jonas Jenwald
b7f987a185 [api-major] Update the minimum supported browsers/environments
In the `legacy`-builds we (obviously) support the currently maintained Firefox ESR version, and looking at the [release history](https://wiki.mozilla.org/Release_Management/Calendar) those are officially supported (by Mozilla) for about 1-1.5 years.
However, for non-Firefox browsers the `legacy`-builds currently attempt to "support" browsers that are approximately *three* years old.[1] Historically, in the PDF.js project, trying to support old browsers have caused some maintenance problems and even delayed adoption of new web-platform features/functionality.

To lessen the support burden, given that the primary purpose of the PDF.js library is still to develop the *built-in* Firefox PDF Viewer, this patch proposes that the upcoming *major* release changes the minimum supported browsers/environments as follows:
 - Chrome 85, which was released on 2020-08-25; see https://en.wikipedia.org/wiki/Google_Chrome_version_history
 - Firefox ESR (as before); see https://wiki.mozilla.org/Release_Management/Calendar
 - Safari 14, which was released on 2020-09-16; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_14
 - Node.js 14 (as before), which is now explicitly listed to prevent it from accidentally breaking; see https://en.wikipedia.org/wiki/Node.js#Releases

---
[1] In older browsers some functionality may not be available and generally we'll ask users to update to a modern browser when bugs, specific to old browsers, are being reported.
2022-09-18 01:12:15 +02:00
Jonas Jenwald
afabbc28c5 Temporarily stop listing the official Chrome extension in the main README
The [official Chrome extension](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) has unfortunately not been updated for *three years*, which means that it's currently missing out on years worth of bug fixes, performance improvements, and new features.
In particular, the Chrome extension suffers from a known bug with non-embedded standard fonts; see issue 13669 for details.

For the time being, this patch proposes that we *temporary* make the following changes:
 - Remove the mention of the official Chrome extension from the main README, since it seems unfortunate to somewhat prominently recommend users an old and partially non-working extension.
 - Don't run the `gulp lint-chromium` task as part of the CI, since in addition to the official extension not having been updated its code is also not being actively maintained.[1]

Once the official Chrome extension has been updated, and it's being actively maintained again, this patch should be simple enough to revert.

---
[1] The last commits, which aren't e.g. linting or general code-maintenance related, happened a year ago now.
2022-09-17 16:29:19 +02:00
Sam Magura
1c2d200918 [api-minor] Use new Worker() syntax in webpack entrypoint
This requires Webpack 5 and will break for anyone using Webpack 4.
worker-loader no longer needs to be installed.
2022-09-13 11:12:00 -04:00
Jonas Jenwald
5b903a6e2d Remove Bower support in pdfjs-dist
Given that the official Bower website, since almost five years, has been advising users to utilize other tools it doesn't seem entirely necessary to keep including the `bower.json` file in the `pdfjs-dist` repository; see e.g. https://bower.io/blog/2017/how-to-migrate-away-from-bower/
2022-09-03 13:05:59 +02:00
Jonas Jenwald
6e31799948 [api-minor] Add the Babel targets-option to avoid transpiling code for unsupported browsers
Currently we simply use the Babel `preset-env` in the `legacy`-builds of the PDF.js library. This has the side-effect of transpiling the code for *very old* browsers/environments, including ones that we (since many years) no longer support which unnecessarily bloats the size of the `legacy`-builds.

For the CSS files we're only targeting *the supported browsers*, and it's thus possible to extend that to also apply to Babel.
One of the most significant changes, with this patch, is that we'll no longer polyfill `async`/`await` in the `legacy`-builds. However, this shouldn't be an issue given the browsers that we currently support in PDF.js; please refer to:
 - https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support
 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#browser_compatibility
2022-08-19 22:19:43 +02:00
Jonas Jenwald
63708a1a5b Remove the extensions/firefox/README.mozilla file (bug 1778567 follow-up)
With the changes made in [bug 1778567](https://bugzilla.mozilla.org/show_bug.cgi?id=1778567), it no longer seems correct to overwrite the mozilla-central file.
2022-08-09 13:13:39 +02:00
Jonas Jenwald
ad11cea33c [api-minor] Update the minimum supported Safari version
The Ink-editor uses `ResizeObserver`, which is supported in all reasonably modern browsers; see https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility

With the exception of Safari, `ResizeObserver` is thus available in all of the browsers that the PDF.js library currently support. Rather than trying to e.g. add a polyfill, let's just bump the compatibility (slightly) to Safari 13.1 instead; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_13
2022-07-31 17:40:26 +02:00
Jonas Jenwald
37ebc28756 Use more for...of loops in the code-base
Note that these cases, which are all in older code, were found using the [`unicorn/no-for-loop`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md) ESLint plugin rule.
However, note that I've opted not to enable this rule by default since there's still *some* cases where I do think that it makes sense to allow "regular" for-loops.
2022-07-17 16:18:54 +02:00
Jonas Jenwald
345bb18575 [editor] Use the fit-curve package (issue 15004)
Rather than including all of this external code in the PDF.js repository, we should be using the npm package instead.
Unfortunately this is slightly more complicated than you'd hope, since the `fit-curve` package (which is older) isn't directly compatible with modern JavaScript modules.
In particular, the following cases needed to be considered:
 - For the development viewer (i.e. `gulp server`) and the unit-tests, we thus need to build a fitCurve-bundle that can be directly `import`ed.
 - For the actual PDF.js build-targets, we can slightly reduce the sizes by depending on the "raw" `fit-curve` source-code.
 - For the Node.js unit-tests, the `fit-curve` package can be used as-is.
2022-07-07 10:43:43 +02:00
Jonas Jenwald
2f0ed3a9ca [api-minor] Update the minimum supported browsers/environments
*Please note:* The dates below are still a little ways off, however that obviously won't affect the existing PDF.js releases. Hence I think that we can make these changes now, since by the time of the *next* official PDF.js release they'll likely match up pretty well.[1]

While we "support" some (by now) fairly old browsers, that essentially means that the library (and viewer) will load and that the basic functionality will work as intended.[2]
However, in older browsers, some functionality may not be available and generally we'll ask users to update to a modern browser when bugs (specific to old browsers) are reported.[3]

Since we've previously settled on only supporting browsers/environments that are approximately *three years old*, this patch updates the minimum supported browsers/environments as follows:
 - Chrome 76, which was released on 2019-07-30; see https://en.wikipedia.org/wiki/Google_Chrome_version_history
 - Firefox ESR (as before); see https://wiki.mozilla.org/Release_Management/Calendar
 - Safari 13, which was released on 2019-09-19; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_13
 - Node.js 14, which was release on 2020-04-21 (all older versions have reached EOL); see https://en.wikipedia.org/wiki/Node.js#Releases

---
[1] Given that the releases usually happen every two to three months.

[2] Assuming that a `legacy/`-build is being used, of course.

[3] In general it's never a good idea to use old/outdated browsers, since those may contain *known* security vulnerabilities.
2022-06-11 16:50:01 +02:00
calixteman
c8f6cb9fcf
Revert "Change the name of the generated pdf.sandbox.external for mozilla-central" 2022-06-10 11:34:28 +02:00
Calixte Denizet
7b37af7eb4 Change the name of the generated pdf.sandbox.external for mozilla-central
This patch is blocking https://phabricator.services.mozilla.com/D148600.
2022-06-08 10:36:38 +02:00
Jonas Jenwald
bb8f5ec20b Bundle the <dialog> polyfill-CSS in the GENERIC legacy/-viewer (PR 14710 follow-up)
In PR 14710 we only included the JavaScript-part of the polyfill, however we probably need to include the CSS as well to reduce the risk of problems in older browsers.

With the recent CSS-related improvements in the `preprocess`-function we could probably have included this conditionally in the `viewer.css` file. However, considering that the `<dialog>` polyfill-code is only invoked when actually needed it seemed most appropriate/correct to lazy-load the polyfill-CSS as well.
2022-06-04 18:11:35 +02:00
Takashi Tamura
10932e3f9d Use globalThis for webpack's output.globalObject instead of this. Close #14915.
That allows us to import pdfjs-dist/build/pdf.js dynamically from modules.

- https://webpack.js.org/configuration/output/#outputglobalobject
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
2022-05-29 11:28:17 +09:00
Jonas Jenwald
5320316f73 Update npm packages 2022-05-15 09:07:35 +02:00
Jonas Jenwald
80910f44e5 Stop bundling the openFile-buttons in the CHROME build
This is, for all intents and purposes, equivalent to PR 14833 and slightly reduces the size of the `gulp chromium` output.
2022-05-07 22:45:56 +02:00
Jonas Jenwald
d1f13a6af3 Use the regular preprocess-function for the CSS files as well
An old shortcoming of the `preprocessCSS`-function is its complete lack of support for our "normal" defines, which makes it very difficult to have build-specific CSS rules. Recently we've started using specially crafted comments to remove CSS rules from the MOZCENTRAL build, but (ab)using the `preprocessCSS`-function in this way really doesn't feel great.
However, it turns out to be surprisingly simple to instead use the "regular" `preprocess`-function for the CSS files as well. The only special-handling that's still necessary is the helper-function for dealing with CSS-imports, but apart from that everything seems to just work.

One reason, as far as I can tell, for having a separate `preprocessCSS`-function was likely that we originally used *lots* of vendor-prefixed CSS rules in our CSS files. With improvements over the years, especially thanks to Autoprefixer and PostCSS, we've been able to remove *almost* all non-standard CSS rules and the need for special-casing the CSS parsing has mostly vanished.

*Please note:* As part of testing this patch I've diffed the output of `gulp generic`, `gulp mozcentral`, and `gulp chromium` against the `master`-branch to check that there was no obvious breakage.
2022-05-07 22:45:52 +02:00
Tim van der Meij
dacd61fede
Update dependencies to the most recent versions
There are two notable changes here:

- `dommatrix` is a major version upgrade, but looking through the commit
  history of their `package.json` file at https://github.com/thednp/dommatrix/commits/master/package.json
  (due to the lack of a changelog) I couldn't find any breaking changes.
- `es-module-shims` is a regular update, but it was previously pinned
  for causing intermittent breakage when running the unit tests in a
  browser manually. Fortunately this cannot be reproduced anymore with
  the most recent version, so we can also put the caret back now.
2022-05-01 13:08:00 +02:00
Jonas Jenwald
b04c373362 Stop bundling the openFile-buttons in the MOZCENTRAL build
Note how both of the openFile-buttons are always hidden during viewer initialization in the MOZCENTRAL build, i.e. the *built-in* Firefox PDF Viewer. Despite that we still include HTML, CSS, and JavaScript code for these buttons in the build.

This patch *reduces* the size of the `gulp mozcentral` output by `1679` bytes, which isn't a lot but still cannot hurt.
2022-04-25 11:35:17 +02:00
Tim van der Meij
b34fb94c68
Merge pull request #14792 from Snuffleupagus/update-packages
Update packages and translations
2022-04-19 21:17:28 +02:00
Jonas Jenwald
bb6bb137cf Remove the web-streams-polyfill Babel-exclusion in gulpfile.js (PR 14560 follow-up)
Given that we're no longer, after PR 14560, bundling the `web-streams-polyfill`-code in the `legacy`-builds we shouldn't need to exclude it from Babel now.
2022-04-17 10:16:50 +02:00
Jonas Jenwald
49d1121f3c Update npm packages 2022-04-17 10:15:10 +02:00
Jonas Jenwald
7023bac8d3 Move the PDFBug-related CSS from viewer.css and into its own file
Given that none of these CSS rules are used at all, unless debugging is enabled, it seems completely unnecessary to load them *unconditionally* for all users.[1]

Note that if *both* the `textLayer` and `pdfBug` debugging hash-parameters are specified simultaneously, we'll now load the `PDFBug`-file *twice* (since the code is simpler that way). However, given first of all that none of this is enabled by default and secondly that using those parameters together isn't helpful[2], potentially loading that file twice is hopefully not an issue.

For the `gulp mozcentral` target, the size of the *built* `viewer.css` file is reduced `> 3%` with this patch.

---
[1] For the Firefox built-in PDF Viewer, in order to even be able to access the `PDFBug` functionality, you need to first of all set `pdfjs.pdfBugEnabled = true` manually in `about:config`. Secondly, you then also need to append the `pdfBug=...` hash-parameter to the URL when *initially* loading the document.

[2] Note how the `textLayer`-settings are already, since essentially forever, overriding the highlighting-features of the "FontInspector"-tab.
2022-04-16 14:16:39 +02:00
Jonas Jenwald
8fa73dbfab Convert web/debugger.js to a *basic* module
The various functionality in `web/debugger.js` is currently *indirectly* added to the global scope, since that's how `var` works when it's used outside of any functions/closures.
Given how this functionality is being accessed/used, not just in the viewer but also in the API and textLayer, simply converting the entire file to a module isn't trivial[1]. However, we can at least export the `PDFBug`-part properly and then `import` that dynamically in the viewer.
Also, to improve the code a little bit, we're now *explicitly* exporting the necessary functionality globally.

According to MDN, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility, all the browsers that we now support have dynamic `imports` implementations.

---
[1] We could probably pass around references to the necessary functionality, but given how this is being used I'm just not sure it's worth the effort. Also, adding *official* support for these viewer-specific debugging tools in the API feels both unnecessary and unfortunate.
2022-04-03 14:30:26 +02:00
Jonas Jenwald
502fd7c80d Stop polyfilling the CSS calc functionality
At this point in time, all browsers that we support have native support for CSS variables; please see https://developer.mozilla.org/en-US/docs/Web/CSS/calc()#browser_compatibility and https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support

We can also remove the hack introduced back in PR 11567, which was only necessary to work-around an IE 11 specific bug.
2022-03-19 14:03:19 +01:00
Jonas Jenwald
c99d558646 Replace dir-dependent margin/margin-left/margin-right with logical properties
*Please note:* This is another step in what will, time permitting, become a series of patches to simplify/modernize the viewer CSS.

Rather than having to manually specify ltr/rtl-specific margin-values in the CSS, we can use logical margin instead (and similar for some related left/right occurrences).
These logical properties depend on, among other things, the direction of the HTML document which we *always* specify in the viewer.

Given that most of these logical CSS properties are fairly new, and that cross-browser support is thus somewhat limited (see below), we need to use a couple of PostCSS plugins (see below) in order to support this in the GENERIC viewer.

 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-start#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-end#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end#browser_compatibility

---

 - https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical
 - https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-dir-pseudo-class
2022-03-19 13:35:24 +01:00
Jonas Jenwald
5180bafb8f [gulpfile.js] Use the regular defines in the preprocessCSS function
Rather than *manually* specifying a "mode", we can simply use the regular `defines` directly instead. To improve consistency, in the `external/builder/builder.js` file, a couple of parameters are also re-named.
2022-03-16 22:39:48 +01:00
Tim van der Meij
489e9ff7d3
Merge pull request #14675 from Snuffleupagus/build-dev-CSS
Build the `web/viewer.css` file used in the development viewer (i.e. `gulp server`)
2022-03-16 20:14:02 +01:00
Jonas Jenwald
e59c2dc308 Build the web/viewer.css file used in the development viewer (i.e. gulp server)
To allow using modern CSS features that currently only Mozilla Firefox supports[1], while still enabling development/testing in recent Google Chrome versions, we'll have to start building the `web/viewer.css` file with `gulp server` as well.

In my testing, building the development CSS (and copying the images) takes *less than* `200 ms` on average which is hopefully an acceptable overhead for this sort of feature.

---
[1] In particular `float`, with `inline-start`/`inline-end` values.
2022-03-15 13:37:44 +01:00
Jonas Jenwald
ee2896dd1e Remove the custom grab/grabbing cursor image files
According to the MDN compatibility data, see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#browser_compatibility, all browsers that we now support should have these cursors available natively.
2022-03-14 14:36:38 +01:00
Jonas Jenwald
6776efe491 [gulpfile.js] Remove the cleanup parameter in preprocessCSS helper function
Every single call-site has always passed in `true` for this parameter, ever since the function was first added back in PR 8023. Hence the parameter appears to be completely unnecessary, which is why it's removed and the function is updated to *unconditionally* strip out any license headers (in the middle of the file).
2022-03-14 13:55:05 +01:00
Jonas Jenwald
157a71d404 [api-minor] Remove the, in legacy builds, bundled DOMMatrix polyfill
According to the MDN compatibility data, see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix#browser_compatibility, all browsers that we support have native `DOMMatrix` implementations (since quite some time too).

Hence Node.js is the only environment that lack `DOMMatrix` support, which probably isn't that surprising given that it's browser functionality.
While the `DOMMatrix` polyfill isn't that large, it nonetheless seems completely unnecessary to bundle it in the `legacy` builds when it's not needed in browsers. However, we can avoid that by simply listing `dommatrix` as a dependency for the `pdfjs-dist` library.
2022-03-08 10:29:11 +01:00
Tim van der Meij
399a0ec603
Merge pull request #14612 from Snuffleupagus/caniuse-lite
Add the `caniuse-lite` package
2022-02-27 15:29:09 +01:00
Jonas Jenwald
896255e7bf Add the caniuse-lite package
Since the Autoprefixer plugin indirectly depends on this, it seems like a good idea to add this as a direct dependency in the PDF.js project to hopefully avoid having to manually update `caniuse-lite` in the future; see https://github.com/browserslist/browserslist#browsers-data-updating

Also, slightly tweaks the Autoprefixer config for GENERIC-builds of the PDF.js library; note that this change doesn't affect the contents of the *built* `web/viewer.js` file.
2022-02-27 11:39:33 +01:00
Jonas Jenwald
ab55071568 Remove the JSDocs "External: Promise"-page, since Promises are now a standard feature
The "External: Promise"-page in the JSDocs pre-dates the introduction of `Promise`s, as a generally available standard JS feature, by a number of years. Hence it now longer seems necessary, as far as I can tell, to include this "special" page in the documentation.

Also, while unrelated to the rest of the patch, updates the `test/`-folder description in the documentation.
2022-02-26 23:53:11 +01:00
Jonas Jenwald
b89595fd20 [api-minor] Remove the, in legacy builds, bundled ReadableStream polyfill
According to the MDN compatibility data, see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#browser_compatibility, all browsers that we support have native `ReadableStream` implementations (since quite some time too).

Hence only Node.js is now lagging behind w.r.t. `ReadableStream` support, and its experimental implementation doesn't really help us given the life-span of the LTS releases (see https://en.wikipedia.org/wiki/Node.js#Releases).
It seems quite unfortunate to bundle a `ReadableStream` polyfill in the `legacy` builds when it's unnecessary in browsers, given its overall size, but fortunately we can avoid that by simply listing `web-streams-polyfill` as a dependency for the `pdfjs-dist` library.
2022-02-13 10:15:58 +01:00
Jonas Jenwald
03f5f6a421 [api-minor] Update the minimum supported browser versions
Please note that while we "support" some (by now) fairly old browsers, that essentially means that the library (and viewer) will load and that the basic functionality will work as intended.[1]
However, in older browsers, some functionality may not be available and generally we'll ask users to update to a modern browser when bugs (specific to old browsers) are reported.[2]

There's always a question of just how old browsers the PDF.js contributors can realistically support, and here I'm suggesting that we place the cut-off point at approximately *three* years.
With that in mind, this patch updates the *minimum* supported browsers (and environments) as follows:
 - Chrome 73, which was released on 2019-03-12; see https://en.wikipedia.org/wiki/Google_Chrome_version_history
 - Firefox ESR (as before); see https://wiki.mozilla.org/Release_Management/Calendar
 - Safari 12.1, which was released on 2019-03-25; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_12
 - Node.js 12, which was release on 2019-04-23 (and will soon reach EOL); see https://en.wikipedia.org/wiki/Node.js#Releases

---
[1] Assuming a `legacy`-build is being used, of course.

[2] In general it's never a good idea to use an old/outdated browser, since those may contain *known* security vulnerabilities.
2022-02-06 13:06:43 +01:00
Jonas Jenwald
18c295f3d8 Disable the browser-tests, during gulp makeref, in Google Chrome on the Windows bot (PR 14392 follow-up)
Either the latest Chromium update, the latest Puppeteer update, or a combination of them both are now causing the Windows bot to timeout during the browser-tests; please see PR 14392.
2022-01-30 18:24:22 +01:00
Jonas Jenwald
d476186b9f Temporarily disable the browser-tests in Google Chrome on the Windows bot
Either the latest Chromium update, the latest Puppeteer update, or a combination of them both are now causing the Windows bot to timeout during the browser-tests.
To unblock both the updates and other improvements (i.e. the `structuredClone` polyfill), let's simply disable the problematic configuration for now since this a Mozilla project after all.
2022-01-27 21:11:45 +01:00
Tim van der Meij
378c08a9b1
Drop the beta logic from the Gulpfile/website/pdfjs.config file
From now on we only make stable releases, so the beta logic should be
removed to simplify the code.
2022-01-02 14:38:36 +01:00
Jonas Jenwald
00f8fab8a5 Add support for modern ECMAScript class features
With ESLint 8 we should now finally be able to start using modern `class` features, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

However, while both ESLint and Acorn now support this, it unfortunately turns out that Escodegen (which we use during building) still lack the necessary support. Looking at https://github.com/estools/escodegen there's not been any updates since last year, and there's also open PRs adding support for these new `class` features.

To avoid blocking usage of these `class` features in the PDF.js code-base, in particular *private* fields/methods, this patch thus proposes that we (hopefully temporarily) switch to an `escodegen` fork that has the necessary support; please see https://www.npmjs.com/package/@javascript-obfuscator/escodegen

While I have no reason to doubt the security of the `escodegen` fork, this patch nonetheless pins the version number. Furthermore, I've also diffed the output of the two `.js`-files in this forked package against the original files without finding anything that looks immediately "dangerous".
2021-10-22 22:01:17 +02:00