Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_pdfviewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-28 15:32:42 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-28 16:01:10 +0300
commitcf41c802ab3f4b6ec15656d28ad86a8a33906c1e (patch)
tree9f0940c72e4e2f2cbfa73de4c664b480d8a14176 /pdfjs-get.js
parent6c4a18e53a59178f5aee0678832962a3ce088103 (diff)
Fix PDF viewer failing on Edge (not based on Chromium)
Since version v2.4.456 the PDF.js library is published as two different packages, a non-translated/non-polyfilled build for modern browsers and an ES5 compatible build for older browsers. The PDF viewer was using the build for modern browsers, so it did not work, for example, on Edge (the original version not based on Chromium). This has been changed to use the ES5 build instead for maximum compatibility. Unfortunately, the ES5 build requires allowing "unsafe-eval" in the iframe where the PDF.js library is loaded. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'pdfjs-get.js')
-rw-r--r--pdfjs-get.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/pdfjs-get.js b/pdfjs-get.js
index 3395572..5305b46 100644
--- a/pdfjs-get.js
+++ b/pdfjs-get.js
@@ -12,7 +12,7 @@ console.info('Fetching pdfjs', PDFJSversion)
const pdfjsProgress = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic)
pdfjsProgress.start(100, 0)
-progress(request(`https://github.com/mozilla/pdf.js/releases/download/v${PDFJSversion}/pdfjs-${PDFJSversion}-dist.zip`), {
+progress(request(`https://github.com/mozilla/pdf.js/releases/download/v${PDFJSversion}/pdfjs-${PDFJSversion}-es5-dist.zip`), {
throttle: 50,
delay: 0,
})