Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 4chan vtuber fan mark adder
- // @match https://boards.4channel.org/*
- // ==/UserScript==
- (function() {
- function addEmoji() {
- for (const e of document.querySelectorAll(".postMessage")) {
- if (e.modded != true) {
- e.modded = true;
- for (const n of e.childNodes) {
- if (n.nodeType === 3) {
- n.nodeValue = n.nodeValue.replace(/\bpomu\b/ig, '🧚🍂Pomu');
- n.nodeValue = n.nodeValue.replace(/\belira\b/ig, '🌤️Elira');
- n.nodeValue = n.nodeValue.replace(/\bewiwa\b/ig, '🌤️Ewiwa');
- }
- }
- }
- }
- }
- // identify an element to observe
- const target = document.querySelector(".thread");
- // create a new instance of `MutationObserver` named `observer`,
- // passing it a callback function
- const observer = new MutationObserver(() => {
- addEmoji();
- });
- observer.observe(target, {
- subtree: true,
- childList: true
- });
- addEmoji();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement