Merge pull request #5758 from mjlyons/ext-link-new-window
Add option to open external links in new window
This commit is contained in:
commit
4c2640dcf0
@ -217,6 +217,9 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
|
|||||||
|
|
||||||
var link = document.createElement('a');
|
var link = document.createElement('a');
|
||||||
link.href = link.title = item.url || '';
|
link.href = link.title = item.url || '';
|
||||||
|
if (item.url && PDFJS.openExternalLinksInNewWindow) {
|
||||||
|
link.target = '_blank';
|
||||||
|
}
|
||||||
|
|
||||||
container.appendChild(link);
|
container.appendChild(link);
|
||||||
|
|
||||||
|
@ -160,6 +160,15 @@ PDFJS.verbosity = (PDFJS.verbosity === undefined ?
|
|||||||
PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
|
PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
|
||||||
16777216 : PDFJS.maxCanvasPixels);
|
16777216 : PDFJS.maxCanvasPixels);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens external links in a new window if enabled. The default behavior opens
|
||||||
|
* external links in the PDF.js window.
|
||||||
|
* @var {boolean}
|
||||||
|
*/
|
||||||
|
PDFJS.openExternalLinksInNewWindow = (
|
||||||
|
PDFJS.openExternalLinksInNewWindow === undefined ?
|
||||||
|
false : PDFJS.openExternalLinksInNewWindow);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document initialization / loading parameters object.
|
* Document initialization / loading parameters object.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user