Skip to content

Instantly share code, notes, and snippets.

@dajnz
Created November 3, 2022 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dajnz/f5af6003ed3a912dba9557770ea0b1a1 to your computer and use it in GitHub Desktop.
Save dajnz/f5af6003ed3a912dba9557770ea0b1a1 to your computer and use it in GitHub Desktop.
Klavogonki Anti Traktor script
;(function () {
let findAttackerLinks = () => {
const ATTACKER_NAME = 'gaychik_monster';
let playerNameLinks = document.querySelectorAll('a[class*="profile"][href^="/profile"]');
if (playerNameLinks.length === 0) return [];
let playerNameLinksArr = Array.prototype.slice.call(playerNameLinks);
let attackerLinks = [];
playerNameLinksArr.forEach(link => {
let playerName = link.textContent.trim();
if (playerName === ATTACKER_NAME) {
attackerLinks.push(link);
}
});
return attackerLinks;
}
let hideGameBlock = (profileLinkElement) => {
let newGameBlock = profileLinkElement.closest('div[id^="game"]');
if (newGameBlock === null) return;
newGameBlock.style.display = 'none';
}
let attackerHider = () => {
let links = findAttackerLinks();
links.forEach(link => {
hideGameBlock(link)
})
window.setTimeout(attackerHider, 50);
}
window.setTimeout(attackerHider, 100);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment