bunjomin
3/1/2019 - 8:22 PM

Make all external links target="_blank"

*** Beta, early access, not for production, use at your own risk! *** DEPENDENCIES: JQUERY LOL

// Select all external links and add attribute target="_blank"
$('a').not('[href^="/"]').not(`[href^="${window.location.host}"]`).not(`[href^="${window.location.protocol}//${window.location.host}"]`).attr('target', '_blank');