无图模式

简单的网页无图模式

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         无图模式
// @namespace
// @include      *
// @exclude      *://greasyfork.org/*
// @version      0.3.0
// @description  简单的网页无图模式
// @author       ymzhao
// @namespace 
// @grant        GM_addStyle
// ==/UserScript==
GM_addStyle(`
    img {
        display: none;
        opacity: 0;
        visibility: hidden;
        z-index: -1;
    }
    div {background-image:none}
`);
;(function() {
    'use strict';

    // hookImg();
    // function hookImg() {
    //     const property = Object.getOwnPropertyDescriptor(Image.prototype, 'src');
    //     const nativeSet = property.set;
    
    //     function customiseSrcSet(url) {
    //         // do something
    //         console.log('23333333333', url)
    //         nativeSet.call(this, 'abc');
    //     }
    //     Object.defineProperty(Image.prototype, 'src', {
    //         set: customiseSrcSet,
    //     });
    // }
})();