File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,13 +42,16 @@ const canDownload = urlParams.get('canDownload')
4242// "PDFViewerApplication" and "PDFViewerApplicationOptions" are globally set and
4343// before "PDFViewerApplication.initialize" is executed.
4444function initializeCustomPDFViewerApplication ( ) {
45+ const head = document . getElementsByTagName ( 'head' ) [ 0 ]
46+
4547 // Preferences override options, so they must be disabled for
4648 // "externalLinkTarget" to take effect.
4749 PDFViewerApplicationOptions . set ( 'disablePreferences' , true )
48- PDFViewerApplicationOptions . set ( 'externalLinkTarget' , pdfjsLib . LinkTarget . BLANK )
50+ // TODO https://github.com/mozilla/pdf.js/pull/14424#issuecomment-1092947792
51+ PDFViewerApplicationOptions . set ( 'externalLinkTarget' , 2 )
4952 PDFViewerApplicationOptions . set ( 'isEvalSupported' , false )
50- PDFViewerApplicationOptions . set ( 'workerSrc' , document . getElementsByTagName ( ' head' ) [ 0 ] . getAttribute ( 'data-workersrc' ) )
51- PDFViewerApplicationOptions . set ( 'cMapUrl' , document . getElementsByTagName ( ' head' ) [ 0 ] . getAttribute ( 'data-cmapurl' ) )
53+ PDFViewerApplicationOptions . set ( 'workerSrc' , head . getAttribute ( 'data-workersrc' ) )
54+ PDFViewerApplicationOptions . set ( 'cMapUrl' , head . getAttribute ( 'data-cmapurl' ) )
5255 PDFViewerApplicationOptions . set ( 'enablePermissions' , true )
5356
5457 if ( canDownload === '0' ) {
You can’t perform that action at this time.
0 commit comments