mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Allow link rel to be customized. Defaults to 'noreferrer'
This commit is contained in:
parent
a8d760d97f
commit
11f3deac56
2 changed files with 13 additions and 0 deletions
|
@ -311,6 +311,11 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
|
|||
link.target = LinkTargetStringMap[PDFJS.externalLinkTarget];
|
||||
}
|
||||
|
||||
// Strip referrer
|
||||
if (item.url) {
|
||||
link.rel = PDFJS.externalLinkRel;
|
||||
}
|
||||
|
||||
if (!item.url) {
|
||||
if (item.action) {
|
||||
bindNamedAction(link, item.action);
|
||||
|
|
|
@ -230,6 +230,14 @@ PDFJS.openExternalLinksInNewWindow = (
|
|||
PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ?
|
||||
PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget);
|
||||
|
||||
/**
|
||||
* Specifies the |rel| attribute for external links. Defaults to stripping
|
||||
* the referrer.
|
||||
* @var {string}
|
||||
*/
|
||||
PDFJS.externalLinkRel = (PDFJS.externalLinkRel === undefined ?
|
||||
'noreferrer' : PDFJS.externalLinkRel);
|
||||
|
||||
/**
|
||||
* 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