Greasy Fork is available in English.

ProxyLoadIMG

[PT] Carrega imagens atraves de um proxy aleatorio. [EN] Load images through a random proxy.

  1. // ==UserScript==
  2. // @name ProxyLoadIMG
  3. // @namespace http://stackoverflow.com/users/982924/rasg
  4. // @author RASG
  5. // @version 2012.06.14
  6. // @description [PT] Carrega imagens atraves de um proxy aleatorio. [EN] Load images through a random proxy.
  7. // @include *
  8. // @exclude *intranet*
  9. // ==/UserScript==
  10.  
  11. /* [PT] SOMENTE IMAGENS SAO CARREGADAS PELO PROXY. LINKS PERMANECEM INTACTOS. */
  12. /* [EN] ONLY IMAGES ARE LOADED THROUGH THE PROXY. LINKS REMAIN UNTOUCHED. */
  13.  
  14. var imagens = ['.bmp', '.gif', '.img', 'imgur.com', '.jpeg', '.jpg', '.png'];
  15. var matriz = ['https://cache-001.appspot.com/','https://cache-003.appspot.com/','https://cache-017.appspot.com/','https://meme-darwin.appspot.com/'];
  16. var proxy = matriz[Math.floor(Math.random() * matriz.length)];
  17. var temproxy = 0;
  18. var url = window.location.href;
  19.  
  20. for (j in matriz)
  21. if (url.indexOf(matriz[j]) > -1)
  22. temproxy = 1;
  23.  
  24. if (temproxy == 0) {
  25. for (var i=0,link; (link=document.links[i]); i++) {
  26. for (h in imagens) {
  27. if (link.href.indexOf(imagens[h]) > -1) {
  28. link.href = link.href.replace(location.protocol + '//', proxy);
  29. //GM_log(link.href);
  30. }
  31. }
  32. }
  33. }
  34.  
  35. /* SUBSTITUI OS 'img src' */
  36. if (temproxy == 0) {
  37. for (var x=0; x<document.images.length; x++) {
  38. imagem = document.images[x];
  39. imagem.src = imagem.src.replace(location.protocol + '//', proxy);
  40. }
  41. }