[Pkg-javascript-commits] [pdf.js] 14/414: Allow link rel to be customized. Defaults to 'noreferrer'

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 11f3deac56a9a410488883f86b3b17a1a69534d9
Author: Tony Jin <tjin at box.com>
Date:   Wed Dec 16 17:26:03 2015 -0800

    Allow link rel to be customized. Defaults to 'noreferrer'
---
 src/display/annotation_layer.js | 5 +++++
 src/display/api.js              | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js
index f140d38..e833204 100644
--- a/src/display/annotation_layer.js
+++ b/src/display/annotation_layer.js
@@ -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);
diff --git a/src/display/api.js b/src/display/api.js
index 1cf5c51..c890df1 100644
--- a/src/display/api.js
+++ b/src/display/api.js
@@ -231,6 +231,14 @@ 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.
   * @var {boolean}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list