Last active
August 30, 2015 13:54
-
-
Save drguildo/147121 to your computer and use it in GitHub Desktop.
A bookmarklet that prompts the user for a search pattern and lists all links on the current page that match it.
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
// javascript:(function(){var x,nD,z,i;x=prompt("Pattern:", "");if(x!=null){nD=window.open().document;nD.writeln('<pre>');z=document.links;for(i=0;i<z.length;++i){if(z[i].href.indexOf(x)!=-1){nD.writeln(z[i].href);}}nD.writeln('</pre>');nD.close();}})(); | |
javascript:( | |
function(){ | |
var x,nD,z,i; | |
x=prompt("Pattern:", ""); | |
if(x!=null) { | |
nD = window.open().document; | |
nD.writeln('<pre>'); | |
z = document.links; | |
for (i = 0; i < z.length; ++i) { | |
if (z[i].href.indexOf(x) != -1 ) { | |
nD.writeln(z[i].href); | |
} | |
} | |
nD.writeln('</pre>'); | |
nD.close(); | |
} | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment