Is there a way to have single-click web links when viewing a document?

Question

By default, in the PrizmDoc Viewer, links are highlighted and underlined in blue. To follow links within a document, the user needs to click the link, wait for the floating popup to appear showing the link’s target URL, and then click that to actually follow the link. Is there a way to make this a single-click process and skip the floating popup?

Answer

The desired one-click functionality can be achieved by modifying the viewer.js source file:

Inspect around line ~9457; you’ll find the following else if block:

    } else if (ev.targetType === "documentHyperlink") {
        hyperlinkMenuHandler(ev, "view");
    }

This line of code executes when the user clicks on a link displayed within the Viewer. The call to hyperlinkMenuHandler is responsible for displaying the floating popup. If you’d like to immediately open the link in a new window/tab instead, replace the contents of the “if else” block with a call to window.open:

    } else if (ev.targetType === "documentHyperlink") {
        window.open(ev.hyperlink.href, '_blank');
    }

This will allow hyperlinks that appear in the Viewer to be followed in a new window/tab with a single-click.