Bring My Color Back

Remove grayscale filter enforced on ominous events. Be happy.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Bring My Color Back
// @namespace    https://greasyfork.org/zh-CN/scripts/455761-bring-my-color-back
// @license MIT
// @version      0.3
// @description  Remove grayscale filter enforced on ominous events. Be happy.
// @author       You
// @match        *://*/*
// @icon         https://images.unsplash.com/photo-1545231097-cbd796f1d95f?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8cmFpbmJvd3xlbnwwfHwwfHw%3D&auto=format&fit=crop&w=600&q=60
// @grant        none
// ==/UserScript==

'use strict';
let defaultTreatment = () => {
    document.getElementsByTagName("html")[0].style.cssText="-webkit-filter: grayscale(0%) !important; filter: grayscale(0%) !important; ";
}

let classRemover = ( className ) => {
    for (let [key, element] of Object.entries(document.getElementsByClassName(className))) {
         if(element != undefined){
             element.classList.remove(className);
         }
     }
}
if(window.location.href.includes("baidu")){
    classRemover("big-event-gray");
}else if(window.location.href.includes("iqiyi")){
    setTimeout(()=>{classRemover("gray")},1000);
}else if(window.location.href.includes("weibo")){
    classRemover("grayTheme");
}else if(window.location.href.includes("qq")){
    setTimeout(()=>{classRemover("gray-style-remembrance")},1000);
}else{
    defaultTreatment();
}