您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove grayscale filter enforced on ominous events. Be happy.
- // ==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();
- }