Greasy Fork

Greasy Fork is available in English.

Re-add VeryPog

Re-adds VeryPog as an emote

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Re-add VeryPog
// @namespace    intercorpse.neoVeryPog
// @version      2025-01-04
// @description  Re-adds VeryPog as an emote
// @author       intercorpse
// @match        https://www.destiny.gg/embed/chat*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==
// With thanks to yuniDev, shamefully lifted and edited PEPE

(function() {
    'use strict';
    GM_addStyle(`.emote.VeryPog_OG { width:32px; height: 30px; background-image: url('https://wikicdn.destiny.gg/0/01/VeryPog.png') }`);
    GM_addStyle(`.msg-chat .emote.VeryPog_OG { margin-top: -30px; top: 7.5px; }`);

    function mutationCallback(mutationsList) {
        for (const mutation of mutationsList) {
            if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
                for (const addedNode of mutation.addedNodes) {
                    const textContainer = addedNode.querySelector(".text");
                    textContainer.innerHTML = textContainer.innerHTML.replace(/(^|\s|>)VeryPog_OG(?=\s|$|<)/g, '$1<div class="emote VeryPog_OG">VeryPog_OG</div>');
                }
            }
        }
    }

    const targetElement = document.getElementById("chat-win-main").querySelector(".chat-lines");

    if (targetElement) {
        const observer = new MutationObserver(mutationCallback);
        observer.observe(targetElement, { childList: true });
    }
})();