Skip to content

Instantly share code, notes, and snippets.

@qwqtoday
Last active June 17, 2025 10:07
Show Gist options
  • Select an option

  • Save qwqtoday/38f700f19f87e1389c2a701a9011bcd6 to your computer and use it in GitHub Desktop.

Select an option

Save qwqtoday/38f700f19f87e1389c2a701a9011bcd6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name [lichess.org] Change Bot Title to "CHEATER"
// @namespace http://tampermonkey.net/
// @version 2025-06-12
// @description Efficiently replaces BOT with CHEATER using MutationObserver
// @author Leung Ho Ching
// @match https://lichess.org/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
function replaceBotText() {
document.querySelectorAll('.utitle').forEach(item => {
if (item.textContent.includes('BOT')) {
item.textContent = item.textContent.replace("BOT", "CHEATER");
}
});
}
// Initial run for existing elements
replaceBotText();
// Set up MutationObserver to watch for DOM changes
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.addedNodes.length) {
replaceBotText();
}
});
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment