meogao222's EH Thumbnail show

my EH script, display thumbnails on the list

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         meogao222's EH Thumbnail show
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  my EH script, display thumbnails on the list
// @author       You
// @match        https://e-hentai.org/?f_search=*
// @match        https://e-hentai.org/
// @match        https://e-hentai.org/uploader/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...

//    setTimeout(start, 200);
    start();

    function start(){
        var allTrEles = document.getElementsByClassName('itg gltc')[0].childNodes[0].childNodes;

        allTrEles.forEach((ele)=>{
            var gl1c = ele.getElementsByClassName('gl1c glcat')[0];
            var gl2cDiv = ele.getElementsByClassName('gl2c')[0];
            if (gl2cDiv){
                var glThumbEle = gl2cDiv.getElementsByClassName('glthumb')[0];
                var imgEleLink = glThumbEle.childNodes[0].childNodes[0].getAttribute('data-src');
                if (!imgEleLink){
                    imgEleLink = glThumbEle.childNodes[0].childNodes[0].getAttribute('src');
                }
                var thumbEle = document.createElement('img');
                thumbEle.setAttribute('src', imgEleLink);
                gl1c.replaceWith(thumbEle);
                glThumbEle.remove();
            }

        });
    }
})();