Opening external links in a new tab for Broadcast Invisible Theme

presently
Excursionist
24 1 4

I've tried to follow this instruction of adding this code to the custom.js file:

var links = document.links; for (let i = 0, linksLength = links.length ; i < linksLength ; i++) { if (links[i].hostname !== window.location.hostname) { links[i].target = '_blank'; links[i].rel = 'noreferrer noopener'; } }

 

But it's not working. Any ideas how to get all external links to open in a new tab?

Replies 0 (0)