From 0c349c701f72abdb254a3d033cf3fa56eb4bc3c9 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 13 Mar 2022 11:38:56 +0100 Subject: [PATCH] Remove the `addLinkAttributes` warnings in the Annotation/XFA-layers (PR 14092 follow-up) These warnings have now been present in three releases, see PR 14092, hence it should (hopefully) be fine to remove them now. --- src/display/annotation_layer.js | 10 +--------- src/display/xfa_layer.js | 11 +---------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index ea9ab09c3..f7a5d6d27 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -481,15 +481,7 @@ class LinkAnnotationElement extends AnnotationElement { const link = document.createElement("a"); if (data.url) { - if ( - (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) && - !linkService.addLinkAttributes - ) { - warn( - "LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance." - ); - } - linkService.addLinkAttributes?.(link, data.url, data.newWindow); + linkService.addLinkAttributes(link, data.url, data.newWindow); } else if (data.action) { this._bindNamedAction(link, data.action); } else if (data.dest) { diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index b34ee33e0..5abbb8a9b 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -16,7 +16,6 @@ /** @typedef {import("./display_utils").PageViewport} PageViewport */ /** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */ -import { warn } from "../shared/util.js"; import { XfaText } from "./xfa_text.js"; /** @@ -134,15 +133,7 @@ class XfaLayer { } if (isHTMLAnchorElement) { - if ( - (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) && - !linkService.addLinkAttributes - ) { - warn( - "XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance." - ); - } - linkService.addLinkAttributes?.( + linkService.addLinkAttributes( html, attributes.href, attributes.newWindow