Skip to content

Instantly share code, notes, and snippets.

@innermond
Created February 10, 2016 14:00
Show Gist options
  • Select an option

  • Save innermond/e0d3cf049ce0f2911ae7 to your computer and use it in GitHub Desktop.

Select an option

Save innermond/e0d3cf049ce0f2911ae7 to your computer and use it in GitHub Desktop.
Bookmark get images href
javascript:void(function() {
document.title = "List images";
var links = document.querySelectorAll('div[data-ved]>a');
var link = "";
var href = "";
var found = [];
for(var inx = 0, len = links.length; inx < len; inx++) {
link = links[inx];
if ( ! href in link) continue;
href = link.href;
found.push(href.match(/\?imgurl=([^&]+)/).pop());
}
var d = window.open("");
d.document.open();
d.title = "Images urls";
d.document.write(found.join("<br>"));
d.document.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment