Skip to content

Commit

Permalink
Merge pull request #589 from nextcloud/fix/loading-after-v2.13.216
Browse files Browse the repository at this point in the history
Fix unknown variable after upgrade from v2.13.216
  • Loading branch information
PVince81 authored Apr 8, 2022
2 parents 258e860 + 23d937e commit 8749b66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/files_pdfviewer-workersrc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/files_pdfviewer-workersrc.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/workersrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ const canDownload = urlParams.get('canDownload')
// "PDFViewerApplication" and "PDFViewerApplicationOptions" are globally set and
// before "PDFViewerApplication.initialize" is executed.
function initializeCustomPDFViewerApplication() {
const head = document.getElementsByTagName('head')[0]

// Preferences override options, so they must be disabled for
// "externalLinkTarget" to take effect.
PDFViewerApplicationOptions.set('disablePreferences', true)
PDFViewerApplicationOptions.set('externalLinkTarget', pdfjsLib.LinkTarget.BLANK)
// TODO https://github.com/mozilla/pdf.js/pull/14424#issuecomment-1092947792
PDFViewerApplicationOptions.set('externalLinkTarget', 2)
PDFViewerApplicationOptions.set('isEvalSupported', false)
PDFViewerApplicationOptions.set('workerSrc', document.getElementsByTagName('head')[0].getAttribute('data-workersrc'))
PDFViewerApplicationOptions.set('cMapUrl', document.getElementsByTagName('head')[0].getAttribute('data-cmapurl'))
PDFViewerApplicationOptions.set('workerSrc', head.getAttribute('data-workersrc'))
PDFViewerApplicationOptions.set('cMapUrl', head.getAttribute('data-cmapurl'))
PDFViewerApplicationOptions.set('enablePermissions', true)

if (canDownload === '0') {
Expand Down

0 comments on commit 8749b66

Please sign in to comment.