mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
[api-minor] Add a wrapper around the addLinkAttributes
-function, in the API, to the PDFLinkService
implementations
This patch helps reduce some duplication, given that we now have a few essentially identical `addLinkAttributes` call-sites in the code-base. To prevent runtime errors in the Annotation/XFA-layer code, we'll warn if a custom/incomplete `PDFLinkService` is being used (limited to GENERIC builds).
This commit is contained in:
parent
bb9c905c5d
commit
8cb6efec2d
9 changed files with 67 additions and 45 deletions
|
@ -338,7 +338,7 @@ const LinkTarget = {
|
|||
|
||||
/**
|
||||
* Adds various attributes (href, title, target, rel) to hyperlinks.
|
||||
* @param {HTMLLinkElement} link - The link element.
|
||||
* @param {HTMLAnchorElement} link - The link element.
|
||||
* @param {ExternalLinkParameters} params
|
||||
*/
|
||||
function addLinkAttributes(link, { url, target, rel, enabled = true } = {}) {
|
||||
|
@ -633,7 +633,6 @@ function getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {
|
|||
|
||||
export {
|
||||
addLinkAttributes,
|
||||
DEFAULT_LINK_REL,
|
||||
deprecated,
|
||||
DOMCanvasFactory,
|
||||
DOMCMapReaderFactory,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue