Clear all animations on all websites
目前為
// ==UserScript==
// @name No Animations
// @namespace No Animations Script
// @version 1.9
// @description Clear all animations on all websites
// @author Nameniok
// @match *://*/*
// @license MIT
// @grant GM_addStyle
// @grant unsafeWindow
// ==/UserScript==
const isSameOrigin = (url) => {
const currentOrigin = window.location.origin;
return url.startsWith(currentOrigin);
};
// Funkcja do usuwania animacji z reguł animacji keyframes
let styleSheets = Array.from(document.styleSheets);
styleSheets.forEach((styleSheet) => {
if (!styleSheet.href || isSameOrigin(styleSheet.href)) {
try {
let cssRules = Array.from(styleSheet.cssRules);
cssRules.forEach((rule) => {
if (rule.type === CSSRule.KEYFRAMES_RULE) {
let keyframes = Array.from(rule.cssRules);
keyframes.forEach((keyframe) => {
keyframe.style.animation = "none";
keyframe.style.animationName = "none";
});
}
});
} catch (error) {
console.error("Error accessing CSS rules:", error);
}
}
});
// Znajdź i dezaktywuj animacje fadeIn
let scripts = document.querySelectorAll("script");
scripts.forEach((script) => {
let scriptContent = script.textContent || script.innerText;
if (scriptContent.includes("fadeIn(")) {
script.textContent = scriptContent.replace(/fadeIn\([^)]*\)/g, "fadeIn(0)");
}
});
// Update specific animations
let transitionElements = document.querySelectorAll("*");
transitionElements.forEach((element) => {
let computedStyle = window.getComputedStyle(element);
let transition = computedStyle.getPropertyValue("transition");
if (transition.includes("flex") || transition.includes("filter")) {
element.style.transition = transition.replace(/flex[^,]*|filter[^,]*/g, "none");
}
});
GM_addStyle(`
* {
transition: none !important;
transition-property: none !important;
transition-duration: 0s !important;
transition-timing-function: initial !important;
-webkit-transition: none !important;
animation-delay: none !important;
animation-duration: none !important;
-webkit-animation-delay: 0 !important;
-webkit-animation-duration: 0 !important;
-moz-animation-delay: 0 !important;
-moz-animation-duration: 0 !important;
-ms-animation-delay: 0 !important;
-ms-animation-duration: 0 !important;
scroll-behavior: auto !important;
marquee-style: none !important;
}
*::before, *::after, *::hover, *::active {
transition: none !important;
transition-property: none !important;
transition-duration: 0s !important;
transition-timing-function: initial !important;
-webkit-transition: none !important;
animation-delay: none !important;
animation-duration: none !important;
-webkit-animation-delay: 0 !important;
-webkit-animation-duration: 0 !important;
-moz-animation-delay: 0 !important;
-moz-animation-duration: 0 !important;
-ms-animation-delay: 0 !important;
-ms-animation-duration: 0 !important;
}
*:before, *:after, *:hover, *:active {
transition: none !important;
transition-property: none !important;
transition-duration: 0s !important;
transition-timing-function: initial !important;
-webkit-transition: none !important;
animation-delay: none !important;
animation-duration: none !important;
-webkit-animation-delay: 0 !important;
-webkit-animation-duration: 0 !important;
-moz-animation-delay: 0 !important;
-moz-animation-duration: 0 !important;
-ms-animation-delay: 0 !important;
-ms-animation-duration: 0 !important;
}
@keyframes {
from {
}
to {
}
}
img[src^="https://i.ytimg.com/an_webp/"] {
display: none !important;
}
img[src*="/hqdefault.jpg"] {
display: initial !important;
}
`);
// Blokowanie animowanych obrazków z YouTube
const blockedUrlPrefix = 'https://i.ytimg.com/an_webp/';
const blockImageLoading = (event) => {
const src = event.target.src || '';
if (src.startsWith(blockedUrlPrefix) || src.endsWith('.webp')) {
event.preventDefault();
}
};
unsafeWindow.addEventListener('beforeload', blockImageLoading, true);
setInterval(function() {
console.clear();
}, 120000);