Skip to content

Instantly share code, notes, and snippets.

@Vanawy
Last active March 22, 2022 07:37
Show Gist options
  • Save Vanawy/c106668695a96e37769e1ddf80bf6ca8 to your computer and use it in GitHub Desktop.
Save Vanawy/c106668695a96e37769e1ddf80bf6ca8 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Belarus Flag Replacer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Vanawy
// @match https://trackmania.io/
// @icon https://www.google.com/s2/favicons?sz=64&domain=trackmania.io
// @grant none
// @source https://gist.githubusercontent.com/Vanawy/c106668695a96e37769e1ddf80bf6ca8/raw/7c85fc6663a71072c519e9063c3f91d51c421f0e/BLR%2520flag%2520replacer%2520%255BTrackmania.io%255D.js
// ==/UserScript==
(new MutationObserver(check)).observe(document, {childList: true, subtree: true});
function check(changes, observer) {
if(document.querySelector('[src="/img/flags/BLR.jpg"]')) {
observer.disconnect();
main();
}
}
function main() {
let flags = document.querySelectorAll('[src="/img/flags/BLR.jpg"]');
for (let flag of flags) {
flag.src = 'https://i.imgur.com/pyPe1V9.png';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment