Greasy Fork is available in English.

Show image directly

Disable the lazy loading images on webpage. The code was modified from stackoverflow https://stackoverflow.com/questions/19333651/change-attribute-from-data-src-to-src-without-jquery

  1. // ==UserScript==
  2. // @namespace https://greatest.deepsurf.us/zh-TW/users/160335-planetoid
  3. // @name Show image directly
  4. // @description Disable the lazy loading images on webpage. The code was modified from stackoverflow https://stackoverflow.com/questions/19333651/change-attribute-from-data-src-to-src-without-jquery
  5. // @license CC-BY-SA-3.0; https://creativecommons.org/licenses/by-sa/3.0/
  6. // @version 0.5
  7. // @match https://mp.weixin.qq.com/*
  8. // @match http://www.xueui.cn/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // ==OpenUserJS.org==
  13. // @author planetoid
  14. // ==/OpenUserJS.org==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. var img_list = document.getElementsByTagName('img');
  20. for (var i=0; i< img_list.length; i++) {
  21. if(img_list[i].getAttribute('data-src')) {
  22. // @match https://mp.weixin.qq.com/*
  23. img_list[i].setAttribute('src', img_list[i].getAttribute('data-src'));
  24. }else if(img_list[i].getAttribute('original')) {
  25. // @match http://www.xueui.cn/*
  26. img_list[i].setAttribute('src', img_list[i].getAttribute('original'));
  27. }
  28. }
  29. })();