nexusmods-image

nexusmods模糊图片直接显示

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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==
// @name         nexusmods-image
// @namespace    http://tampermonkey.net/
// @version      1.1
// @license      MPL-2.0
// @description  nexusmods模糊图片直接显示
// @author       brackrock12
// @match        https://www.nexusmods.com/*
// @require      http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// ==/UserScript==

(function () {
    'use strict';

    function show_Image() {

        $("[class*='blur-image']").each(function () {
            const img = $(this);
            const classlist = img.attr('class').split(' ');
            classlist.forEach(element => {
                if (element.indexOf('blur-image') > -1) {
                    img.removeClass(element);
                }
            });
        });

        $(".mod_adult_warning_wrapper").each(function () {
            $(this).hide();
        });
        $(".unblur-btn").each(function () {
            $(this).hide();
        });
        $(".blur-description").each(function () {
            $(this).removeClass('blur-description');
        });

        if ($(".mod_adult_warning_wrapper").length == 0) return;

        // Firefox和Chrome早期版本中带有前缀
        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
        // 选择目标节点
        var target = document.querySelector('body');
        // 创建观察者对象
        var observer = new MutationObserver(function (mutations) {
            const subimg = $("[class*='blur-image']");
            if (subimg.length == 0) {
                return;
            }
            subimg.each(function () {
                const img = $(this);
                const classlist = img.attr('class').split(' ');
                classlist.forEach(element => {
                    if (element.indexOf('blur-image') > -1) {
                        img.removeClass(element);
                    }
                });
            });
            $(".unblur-btn").each(function () {
                $(this).hide();
            });
            // if (subimg.length == 0) {
            //     observer.disconnect();
            // }
        });
        // 配置观察选项:
        var config = { attributes: true, childList: true, characterData: true, subtree: true }         // 传入目标节点和观察选项
        observer.observe(target, config);
    }

    setTimeout(show_Image, 100);

})();