Original PogChamp replace

Replace new PogChamp emotes to old

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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