Skip to content

Instantly share code, notes, and snippets.

@veltman
Created February 11, 2014 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veltman/8945915 to your computer and use it in GitHub Desktop.
Save veltman/8945915 to your computer and use it in GitHub Desktop.
Get all PDFs on a page (bookmarklet)
javascript:(function(){ document.getElementsByTagName("body")[0].innerHTML = Array.prototype.slice.call(document.getElementsByTagName("a"), 0 ).filter(function(d){ return d.href.match(/[.]pdf$/i);}).map(function(d){ return d.href.match(/^https?:/i) ? d.href : (window.location.href.match(/\/^/) ? window.location.href+d.href : window.location.href.split("/").slice(0,-1).join("/")+"/"+d.href ); }).join("\n<br/>"); }());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment