Greasy Fork is available in English.
Blur specific elements on stake.com, stake.bet, and stake.ac.
当前为
// ==UserScript==
// @name Stake Blur Script
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Blur specific elements on stake.com, stake.bet, and stake.ac.
// @author Dave
// @match *://stake.com/*
// @match *://stake.bet/*
// @match *://stake.ac/*
// @grant none
// @run-at document-end
// @license MIT
// ==/UserScript==
(function() {
const blurValue = '5px';
function blurElements(node) {
node.querySelectorAll('svg.svelte-md2ju7').forEach(el => {
if (el.getAttribute('viewBox') !== '0 0 396.11 197.92') {
el.style.filter = `blur(${blurValue})`;
}
});
node.querySelectorAll('svg[width="885"][height="465"]').forEach(el => {
el.style.filter = `blur(${blurValue})`;
});
node.querySelectorAll('img[alt="Stake Logo"]').forEach(el => {
el.style.filter = `blur(${blurValue})`;
});
node.querySelectorAll('img[alt="Sports"]').forEach(el => {
el.style.filter = `blur(${blurValue})`;
});
}
function processNode(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
blurElements(node);
}
}
blurElements(document);
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(addedNode => {
processNode(addedNode);
});
});
});
observer.observe(document.body, { childList: true, subtree: true });
})();
(function() {
const selector = '.back.svelte-mru6at.face-down';
const blurValue = '4px';
function applyBlurToElement(el) {
el.style.filter = `blur(${blurValue})`;
}
function applyBlurToAll() {
const elements = document.querySelectorAll(selector);
elements.forEach(applyBlurToElement);
}
applyBlurToAll();
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.type === 'childList' || mutation.type === 'attributes') {
applyBlurToAll();
}
});
});
observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style'] });
setInterval(applyBlurToAll, 1000);
})();