User Tools

Site Tools


bookmarklet_--_open_all_image_links

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
bookmarklet_--_open_all_image_links [2011/04/24 21:44]
tkbletsc
bookmarklet_--_open_all_image_links [2011/04/24 21:56] (current)
tkbletsc
Line 14: Line 14:
  var doc = "​data:​text/​html,<​html><​head><​title>​Images of '"​+document.title+"'</​title></​head>";​  var doc = "​data:​text/​html,<​html><​head><​title>​Images of '"​+document.title+"'</​title></​head>";​
  doc += "<​body style='​text-align:​center;​ font-family:​ Verdana, sans-serif; font-size:​80%;'><​H1>​Images of <a href='"​+document.URL+"'>"​+document.title+"</​a></​h1>";​  doc += "<​body style='​text-align:​center;​ font-family:​ Verdana, sans-serif; font-size:​80%;'><​H1>​Images of <a href='"​+document.URL+"'>"​+document.title+"</​a></​h1>";​
 + seen = {};
  for(var i = 0; i < document.links.length;​ i++) {  for(var i = 0; i < document.links.length;​ i++) {
  link = document.links[i].href;​  link = document.links[i].href;​
- if (link.match(regex)) {+ if (link.match(regex) ​&& !seen[link]) {
  doc += "<​img src='"​+link+"'><​br>​\n";​  doc += "<​img src='"​+link+"'><​br>​\n";​
  doc += "<a href='"​+link+"'>"​+link+"</​a><​p>";​  doc += "<a href='"​+link+"'>"​+link+"</​a><​p>";​
 + seen[link] = 1;
  }  }
  }  }
bookmarklet_--_open_all_image_links.txt ยท Last modified: 2011/04/24 21:56 by tkbletsc