Skip to content

Commit 0c349c7

Browse files
committed
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.
1 parent 9e4aaf1 commit 0c349c7

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

src/display/annotation_layer.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,7 @@ class LinkAnnotationElement extends AnnotationElement {
481481
const link = document.createElement("a");
482482

483483
if (data.url) {
484-
if (
485-
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
486-
!linkService.addLinkAttributes
487-
) {
488-
warn(
489-
"LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance."
490-
);
491-
}
492-
linkService.addLinkAttributes?.(link, data.url, data.newWindow);
484+
linkService.addLinkAttributes(link, data.url, data.newWindow);
493485
} else if (data.action) {
494486
this._bindNamedAction(link, data.action);
495487
} else if (data.dest) {

src/display/xfa_layer.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
/** @typedef {import("./display_utils").PageViewport} PageViewport */
1717
/** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */
1818

19-
import { warn } from "../shared/util.js";
2019
import { XfaText } from "./xfa_text.js";
2120

2221
/**
@@ -134,15 +133,7 @@ class XfaLayer {
134133
}
135134

136135
if (isHTMLAnchorElement) {
137-
if (
138-
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
139-
!linkService.addLinkAttributes
140-
) {
141-
warn(
142-
"XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance."
143-
);
144-
}
145-
linkService.addLinkAttributes?.(
136+
linkService.addLinkAttributes(
146137
html,
147138
attributes.href,
148139
attributes.newWindow

0 commit comments

Comments
 (0)