Hotkey zoom for GeoGuessr

Zoom in on 'v' and out on 'x', works for both map and game. Only tested on chrome.

  1. // ==UserScript==
  2. // @name Hotkey zoom for GeoGuessr
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-03-09
  5. // @description Zoom in on 'v' and out on 'x', works for both map and game. Only tested on chrome.
  6. // @author github.com/hallunbaek
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var event;
  16.  
  17. document.addEventListener('mousemove', e => {
  18. event = e;
  19. }, {passive: true});
  20.  
  21. var interval;
  22.  
  23. const scroller = (up) => {
  24. if (interval) window.clearInterval(interval);
  25. interval = window.setInterval(() => {
  26. event.initEvent('wheel', true, true);
  27. event.deltaY = up ? 1 : -1;
  28. document.elementFromPoint(event.clientX, event.clientY).dispatchEvent(event);
  29. }, 10);
  30. };
  31.  
  32. window.addEventListener('keydown', (e) => {
  33. if (e.key == "x"){
  34. scroller(true);
  35. } else if (e.key == "v"){
  36. scroller(false);
  37. }
  38. });
  39.  
  40. window.addEventListener('keyup', () => window.clearInterval(interval));
  41. })();

QingJ © 2025

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