Skip to content

Instantly share code, notes, and snippets.

@TheSnowfield
Last active December 1, 2022 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSnowfield/da73d81f4a05206bb05288513dde1d9a to your computer and use it in GitHub Desktop.
Save TheSnowfield/da73d81f4a05206bb05288513dde1d9a to your computer and use it in GitHub Desktop.
remove grayscale
// ==UserScript==
// @name Fuck Grayscale
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// get all elements
const list = document.querySelectorAll('*');
// key words of classes
const keywords = ['gray', 'big-event-gray', 'grayTheme', 'tb-allpage-filter'];
window.onload = () => {
// remove grayscale filters
list.forEach(i => {
// remove style
if(i.style.filter.startsWith('grayscale')) {
i.style.filter = '';
}
// remove style classes
keywords.forEach(j => {
i.classList.remove(j);
});
});
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment