Link handler

The linkhandler is a simple JS library shipped with WebHare to open all external links in a new tab/window

   import { openLinksInNewWindow } from '@mod-publisher/js/linkhandler';
   openLinksInNewWindow();

   openLinksInNewWindow( { options... } );

Supported options are:

The linkhandler works by setting the target to _blank when the link is clicked to ensure it plays nice with existing link tracking scripts (which might fail if we cancelled the event and did a window.open). <a> click events which are cancelled are ignored.

Links to non http/https locations, <a download> links and links which already have a target attribute, are all ignored. You can override the 'open in new window' behaviour for a specific link by setting target="_self"