// ==UserScript== // @name /noparse in chat // @namespace http://tampermonkey.net/ // @version 1.1 // @description Enables the use of /noparse to insert 0-width spaces // @author JK_3 // @match https://www.warzone.com/MultiPlayer?ChatRoom=1 // @grant none // @downloadURL https://update.greasyfork.icu/scripts/469392/noparse%20in%20chat.user.js // @updateURL https://update.greasyfork.icu/scripts/469392/noparse%20in%20chat.meta.js // ==/UserScript== (function() { 'use strict'; console.log("Starting /noparse script") let waitPopup = document.getElementById("WaitDialogJSMainDiv") let intervalID = null function applyEventHandlers() { for (let input of document.querySelectorAll("[id^='ujs_SendChatText'][id$='input']")) { input.oninput = (event) => { let elem = document.getElementById(event.srcElement.id) elem.value = elem.value.replace("/noparse","\u200B") elem.value = elem.value.replace("/leftrightmark", "\u200E") } } console.log("Completed /noparse script") } function checkIfPageReady(){ if (waitPopup.style.display == 'none') { clearInterval(intervalID) applyEventHandlers() } } intervalID = setInterval(checkIfPageReady, 250) })();