MuteGreyTheme

移除灰色模式

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

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