Color

去除灰色,恢复彩色

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Color
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  去除灰色,恢复彩色
// @author       Joye-bot
// @license      GPL-3.0 License
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';


    // Your code here...
    let style = document.createElement("style");
    style.innerHTML = "* {filter: none !important;}";
    document.head.appendChild(style);

    let url = window.location.href;

    // 去百度
    function remove_class(name) {
        let index = document.getElementsByClassName(name);
        for (let i = 0; i < index.length; i++) {
            index[i].classList.remove(name);
        }
    }

    remove_class('gray');
    remove_class('big-event-gray');

    if (url.match(/https:\/\/www.baidu.com\/$/)) {
        document.getElementById("s_lg_img").setAttribute("src", "https://www.baidu.com/img/flexible/logo/pc/index.png");
        document.getElementById("s_lg_img_new").setAttribute("src", "https://www.baidu.com/img/flexible/logo/pc/index.png");
        document.getElementById("su").style.setProperty("background-color", "#4e6ef2", "important");

        if (document.getElementsByClassName("index-logo-src").length === 1) {
            document.getElementsByClassName("index-logo-src")[0].setAttribute("src", "https://www.baidu.com/img/flexible/logo/pc/result.png");
            document.getElementsByClassName("index-logo-peak")[0].setAttribute("src", "https://www.baidu.com/img/flexible/logo/pc/result.png");
            document.getElementsByClassName("index-logo-srcnew")[0].setAttribute("src", "https://www.baidu.com/img/flexible/logo/pc/result.png");
        }
        if (document.getElementById("logo")) {
            document.getElementById("logo").getElementsByTagName("a")[0].getElementsByTagName("img")[0].setAttribute("src", "https://www.baidu.com/img/flexible/logo/logo_web.png");
        }
    }

    if (url.match(/https:\/\/m.baidu.com\/$/)) {
        document.getElementById("logo").getElementsByTagName("a")[0].getElementsByTagName("img")[0].setAttribute("src", "https://www.baidu.com/img/flexible/logo/logo_web.png");
    }

})();