Created
September 1, 2017 09:36
-
-
Save SalvadorP/cf06b10867dacc2083fc23b05e338b47 to your computer and use it in GitHub Desktop.
Script to open all a links which have target = "_blank"
This file contains 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
// Modified from the one found here: https://stackoverflow.com/a/2260289/1540591 | |
var myLinks = document.getElementsByTagName("a"); | |
for (var i = 0; i < myLinks.length; i++) { | |
currentlink = myLinks[i]; | |
if (currentlink.target.substring(0,12) === "_blank") { | |
currentlink.click(); | |
// console.log(currentlink); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment