Original PogChamp replace

Replace new PogChamp emotes to old

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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)
})();