Re-adds VeryPog as an emote
当前为
// ==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 });
}
})();