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 για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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'));
        }
    }
})();