Created
May 21, 2021 08:48
-
-
Save jurajk/1d1b032515f261a57f9cbbc059e451fa to your computer and use it in GitHub Desktop.
Open all same-page links
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
for (var i = 0; i < document.links.length; i++) { | |
if (document.links[i].hostname === location.hostname) { | |
window.open(document.links[i].href, '_blank') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment