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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @namespace    https://greasyfork.org/zh-TW/users/160335-planetoid
// @name         Show image directly
// @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
// @license      CC-BY-SA-3.0; https://creativecommons.org/licenses/by-sa/3.0/
// @version      0.5
// @match        https://mp.weixin.qq.com/*
// @match        http://www.xueui.cn/*
// @grant        none
// ==/UserScript==

// ==OpenUserJS.org==
// @author       planetoid
// ==/OpenUserJS.org==

(function() {
    'use strict';

    var img_list = document.getElementsByTagName('img');
    for (var i=0; i< img_list.length; i++) {
        if(img_list[i].getAttribute('data-src')) {
            // @match https://mp.weixin.qq.com/*
            img_list[i].setAttribute('src', img_list[i].getAttribute('data-src'));
        }else if(img_list[i].getAttribute('original')) {
            // @match http://www.xueui.cn/*
            img_list[i].setAttribute('src', img_list[i].getAttribute('original'));
        }
    }
})();