MuteGreyTheme

移除灰色模式

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         MuteGreyTheme
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  移除灰色模式
// @author       You
// @match        *://weibo.com/*
// @match        *://www.mgtv.com/
// @match        *://www.bilibili.com/
// @match        *://*.baidu.com/
// @match        *://v.qq.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mgtv.com
// @grant        unsafeWindow
// @grant        GM_log
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    GM_log('开始啦')
    window.onload=function(){
        //腾讯视频
        if (document.querySelectorAll(".gray-style-remembrance").length > 0) {
            GM_log('更新style')
            document.querySelectorAll(".gray-style-remembrance").forEach( a => {
                    a.classList.remove('gray-style-remembrance')
                })
            setTimeout(e => {
                GM_log('延迟更新style')
                document.querySelectorAll(".gray-style-remembrance").forEach( a => {
                    a.classList.remove('gray-style-remembrance')
                })
            }, 1000 )
        } else
        //b站
        if(document.querySelector('html').getAttribute('class') === 'gray'){
            GM_log('B站逻辑')
            document.querySelector('html').removeAttribute('class', 'gray');
        } else
        //芒果
        if(document.querySelector('body').getAttribute('class') === 'page-gray'){
            GM_log('芒果逻辑')
            document.querySelector('body').removeAttribute('class', 'page-gray');
        } else
        //百度
        if(document.querySelector('body').getAttribute('class') === 'big-event-gray'){
            GM_log('百度逻辑')
            document.querySelector('body').removeAttribute('class', 'big-event-gray');
        } else
        //微博 一定是放最后
        if (document.querySelectorAll("style").length > 0) {
            GM_log('微博逻辑')
            document.querySelectorAll("style").forEach( a => {
                if(a.innerHTML.includes('grayTheme')){
                    GM_log('更新style')
                    a.innerHTML=''
                }
            })
        }
    }
})();