Created
September 18, 2020 10:50
-
-
Save hsleonis/48dfc109b8f72045652c88eddb7c8321 to your computer and use it in GitHub Desktop.
Shopify theme menu new tab on external url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment