YouTube: disable rolling numbers count up animation

Remove the annoying count up animation for likes and video views on YouTube

اعتبارا من 25-02-2025. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name          YouTube: disable rolling numbers count up animation
// @description   Remove the annoying count up animation for likes and video views on YouTube
// @author        Konf
// @namespace     https://greasyfork.org/users/424058
// @icon          https://www.google.com/s2/favicons?sz=64&domain=www.youtube.com
// @version       2.0.0
// @match         https://www.youtube.com/*
// @compatible    Chrome
// @compatible    Opera
// @compatible    Firefox
// @run-at        document-idle
// @grant         unsafeWindow
// @noframes
// ==/UserScript==

/**
 * Hi! Don't change (or even resave) anything here because
 * by doing this in Tampermonkey you will turn off updates
 * of the script (idk about other script managers).
 * This could be restored in settings but it might be hard to find,
 * so better to reinstall the script if you're not sure
 */

/* jshint esversion: 8 */

(function() {
  'use strict';

  setTimeout(() => {
    const AnimationCopy = unsafeWindow.Animation;

    unsafeWindow.Animation = function(effect, timeline, ...otherArgs) {
      if (effect.target.localName === 'animated-rolling-character') {
        effect.activeDuration = 0;
        effect.timing._duration = 0;
        effect._timingInput.duration = 0;
      }

      return new AnimationCopy(effect, timeline, ...otherArgs);
    };
  }, 3000);
})();