Google Image Link Direct

Click Image View New Location, directly to the images

  1. // ==UserScript==
  2. // @name Google Image Link Direct
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @license MIT
  6. // @description Click Image View New Location, directly to the images
  7. // @author Benyamin Limanto
  8. // @run-at document-end
  9. // @include http*://*.google.tld/search*tbm=isch*
  10. // @include http*://*.google.tld/imgres*
  11. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. document.body.addEventListener('click', e => {
  18. setTimeout(function(){
  19. var div = document.querySelectorAll('a[target=_blank] > img');
  20. for (var i = 0; i < div.length; i++) {
  21. div[i].parentNode.href = div[i].src;
  22. div[i].onload = function(e) {
  23. e.target.parentNode.href = e.target.src;
  24. };
  25. }
  26. }, 500);
  27. });
  28. })();