1. // ==UserScript==
  2. // @name Hide geoguessr cheaters
  3. // @namespace [email protected]
  4. // @version 1.0
  5. // @description Hide previous cheaters on Daily Challenge completely and cheater tables until manual selection
  6. // @author hakai
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=geoguessr.com
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. class S{constructor(){this.h=document.getElementsByTagName("head")[0]}add(e){let s=document.createElement("style");s.textContent=e;this.h.appendChild(s);return s;}}let style=new S;
  14. style.add('.leaderboard:not(.show-muppets) .leaderboard__row:not(.leaderboard__row--highlight),'+
  15. '.highscore:not(.show-muppets) .table__row:not(.table__row--highlighted), '+
  16. '.results-highscore:not(.show-muppets) .results-highscore__cell:not(.results-highscore__cell--selected):not(.show-me) {display:none;}');
  17. let main = document.querySelector('main');
  18. if (main !== null) {
  19. main.addEventListener('click', (e) => {
  20. if (e.target.className.startsWith('button-bar__button') || e.target.className.startsWith('results-highscore__divider')) {
  21. let muppetList = document.querySelector('.leaderboard, .highscore, .results-highscore');
  22. if (muppetList !== null && !muppetList.className.includes('show-muppets')) {
  23. muppetList.className += ' show-muppets';
  24. }
  25. return;
  26. }
  27. let unhideMe = e.target.closest('.results-highscore__cell:not(.show-me)');
  28. if (unhideMe !== null) {
  29. unhideMe.className += ' show-me';
  30. let prev = unhideMe.previousElementSibling;
  31. console.log(prev);
  32. while (!typeof prev !== "undefined" && !prev.className.startsWith('results-highscore__divider')) {
  33. prev.className += ' show-me';
  34. prev = prev.previousElementSibling;
  35. }
  36. let next = unhideMe.nextElementSibling;
  37. while (!typeof next !== "undefined" && !next.className.startsWith('results-highscore__divider')) {
  38. next.className += ' show-me';
  39. next = next.nextElementSibling;
  40. }
  41. }
  42. });
  43. }
  44. })();
Comments powered by Disqus