mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
[api-minor] Add an option to PDFJS for specifying the |target| attribute of external links
Replaces `PDFJS.openExternalLinksInNewWindow` with a more generic configuration option. *Note:* `PDFJS.openExternalLinksInNewWindow = true;` is equal to `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK;`.
This commit is contained in:
parent
d89fde05b0
commit
9ab896e307
3 changed files with 62 additions and 5 deletions
|
@ -169,14 +169,27 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
|
|||
16777216 : PDFJS.maxCanvasPixels);
|
||||
|
||||
/**
|
||||
* Opens external links in a new window if enabled. The default behavior opens
|
||||
* external links in the PDF.js window.
|
||||
* (Deprecated) 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);
|
||||
|
||||
/**
|
||||
* Specifies the |target| attribute for external links.
|
||||
* The constants from PDFJS.LinkTarget should be used:
|
||||
* - NONE [default]
|
||||
* - SELF
|
||||
* - BLANK
|
||||
* - PARENT
|
||||
* - TOP
|
||||
* @var {number}
|
||||
*/
|
||||
PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ?
|
||||
PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget);
|
||||
|
||||
/**
|
||||
* Determines if we can eval strings as JS. Primarily used to improve
|
||||
* performance for font rendering.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue