Original PogChamp replace

Replace new PogChamp emotes to old

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey 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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

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

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

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

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

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

// ==UserScript==
// @name         Original PogChamp replace
// @name:ru      Возвращение старого PogChamp
// @version      1.0.1
// @description  Replace new PogChamp emotes to old
// @description:ru  Меняет новый PogChamp на старый
// @author       yokkkoso
// @match        *://twitch.tv/*
// @match        *://*.twitch.tv/*
// @grant        none
// @namespace https://greasyfork.org/users/726800
// ==/UserScript==

(function() {
    function getImagesByAlt(alt) {
        var allImages = document.getElementsByTagName("img");
        var images = [];
        for (var i = 0, len = allImages.length; i < len; ++i) {
            if (allImages[i].alt === alt) {
                images.push(allImages[i]);
            }
        }
        return images;
    }

    setInterval(function(){
        var PogChamps = getImagesByAlt('PogChamp');
        PogChamps.forEach(function(champ){
            if(champ.classList.contains('emote-picker__image') || champ.classList.contains('emote-picker__emote-image')){
                champ.src = "https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/1x";
                champ.srcset = "https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/1x 1.0x, https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/2x 2.0x, https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/3x 3.0x";

            }if(champ.classList.contains('chat-line__message--emote')){
                champ.src = "https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/1x";
                champ.srcset = "https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/1x 1x, https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/2x 2x, https://cdn.betterttv.net/emote/5db3d44afb4519723fb2a071/3x 4x";
            }
        })
    },100)
})();