Geoguessr Blink Mode

Gives you one second per round, but instead of ending instantly, the screen goes black and you have unlimited time to make your guess.

当前为 2022-01-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Geoguessr Blink Mode
  3. // @description Gives you one second per round, but instead of ending instantly, the screen goes black and you have unlimited time to make your guess.
  4. // @version 0.1.0
  5. // @author macca#8949
  6. // @license MIT
  7. // @include https://www.geoguessr.com/*
  8. // @run-at document-start
  9. // @grant none
  10. // @namespace https://gf.qytechs.cn/en/scripts/438579-geoguessr-blink-mode
  11. // ==/UserScript==
  12.  
  13. const timeLimit = 1.0; // MODIFY THIS IF YOU WANT TO CHANGE THE TIME
  14.  
  15. if (sessionStorage.getItem('1SPREnabled') == null) {
  16. sessionStorage.setItem('1SPREnabled', 'disabled');
  17. }
  18.  
  19. window.toggleScript = function(e) {
  20. if (e.checked) {
  21. sessionStorage.setItem('1SPREnabled', 'enabled');
  22. } else {
  23. sessionStorage.setItem('1SPREnabled', 'disabled');
  24. }
  25. }
  26.  
  27. function check(changes, observer) {
  28. if (document.querySelector('.checkboxes--vertical') && document.querySelector('#enableScript') === null) {
  29. document.querySelector('.checkboxes--vertical').insertAdjacentHTML('beforeend', '<div class="checkboxes checkboxes--vertical"><label class="checkbox"><input type="checkbox" id="enableScript" onclick="toggleScript(this)" class="checkbox__input" name="show-game-settings"><span class="checkbox__mark checkbox__mark--dark"></span> <span class="game-settings__checkbox-main-label">Enable Blink Mode</span><br></label></div>');
  30. if (sessionStorage.getItem('1SPREnabled') === 'enabled') {
  31. document.querySelector('#enableScript').checked = true;
  32. }
  33. }
  34. }
  35.  
  36. (new MutationObserver(check)).observe(document, {childList: true, subtree: true});
  37.  
  38. const checkElement = async selector => {
  39. while (document.querySelector(selector) === null) {
  40. await new Promise(resolve => requestAnimationFrame(resolve));
  41. }
  42. return document.querySelector(selector);
  43. };
  44.  
  45. const respondToVisibility = function(element, callback) {
  46. var options = {
  47. root: document.documentElement
  48. }
  49.  
  50. var observer = new IntersectionObserver((entries, observer) => {
  51. entries.forEach(entry => {
  52. callback(entry.intersectionRatio > 0);
  53. });
  54. }, options);
  55.  
  56. observer.observe(element);
  57. }
  58.  
  59. checkElement('.widget-scene-canvas').then((canvas) => {
  60. respondToVisibility(canvas, visible => {
  61. if (sessionStorage.getItem('1SPREnabled') === 'enabled') {
  62. setTimeout(() => {
  63. canvas.style.display = 'none';
  64. }, (timeLimit + 0.5) * 1000);
  65. }
  66. });
  67. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址