No Animations

Clear all animations on websites

2023-10-23 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        No Animations
// @namespace   No Animations Script
// @version     2.8
// @description Clear all animations on websites
// @author      Nameniok
// @match       *://*/*
// @license     MIT
// @grant       GM_addStyle
// @grant       unsafeWindow
// ==/UserScript==

const isSameOrigin = (url) => {
  const currentOrigin = window.location.origin;
  return url.startsWith(currentOrigin);
};

GM_addStyle(`
  * {
    transition: none !important;
    transition-property: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    transition-timing-function: initial !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-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;
    -o-animation-delay: 0 !important;
    -o-animation-duration: 0 !important;
    scroll-behavior: auto !important;
    marquee-style: none !important;
    -moz-scroll-behavior: auto !important;
    -moz-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;
  }

  *: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;
  }

  input, textarea, button, select, div, a {
    -webkit-tap-highlight-color: transparent;
  }

  img[src^="https://i.ytimg.com/an_webp/"] {
    display: none !important;
  }

  img[src*="/hqdefault.jpg"] {
    display: initial !important;
  }

  @keyframes {
    from {

    }
    to {

    }
  }
`);

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();
    event.target.style.display = 'none';
  }
};

unsafeWindow.addEventListener('beforeload', blockImageLoading, true);