Skip to content

Instantly share code, notes, and snippets.

@dafi
Created September 13, 2011 06:06
Show Gist options
  • Save dafi/1213231 to your computer and use it in GitHub Desktop.
Save dafi/1213231 to your computer and use it in GitHub Desktop.
Bookmarklet to extract links from page
var n = document.querySelectorAll('a[href*=fileserve]');
var s = '';
for (var i = 0; i < n.length; i++) {
s += n[i].getAttribute('href') + '\n';
}
var ta = document.createElement('textarea');
ta.setAttribute('rows', '20');
ta.setAttribute('cols', '100');
ta.value = s;
document.body.appendChild(ta);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment