Web SDKv1.0.0

Links

The links written into the document. Web links open in a new tab (scheme-allowlisted — javascript: and data: URIs are never followed), internal links jump to their page. With callbacks.onExternalLink set, the checked address goes to your handler instead and confirmExternal no longer applies. The Link tool that writes new links is tools.link.
LinksConfigconfig.links

Example

viewer.tsTypeScript
links: {
  enabled: true,
  confirmExternal: false,
  pill: true,
}

Options 3

enabledbooleanDefaulttrue
Clickable in-document links. A click follows a link in Select and with no tool (not a click that ends a selection over its words); links are not followed in Pan. Web links open in a new tab with noopener,noreferrer; only http:, https:, mailto: and tel: addresses are followed, and a link with any other scheme reads as no link.
enabledTypeScript
links: { enabled: false }
confirmExternalbooleanDefaulttrue
Ask before a link leaves the document: a small dialog names the site and shows the full address (or the addressee of a mailto:, the number of a tel:) and waits for the reader to confirm, since a document written by someone else can put any address under any words. false opens web links on the first click. No longer applies once callbacks.onExternalLink is set.
pillbooleanDefaulttrue
The pill naming a link's destination on hover / first tap — on a touch screen, after a first tap, with an Open button. Off, links stay clickable and a tap follows at once; confirmExternal still names a web address before leaving.