OpenGuessr Hack Location Finder

Extract and open PanoramaIframe location in Google Maps full site when pressing Control + X + S together

2024-12-01 일자. 최신 버전을 확인하세요.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name OpenGuessr Hack Location Finder
  3. // @namespace https://openguessr.com/
  4. // @version 1.7
  5. // @description Extract and open PanoramaIframe location in Google Maps full site when pressing Control + X + S together
  6. // @author YourName
  7. // @license MIT
  8. // @match https://openguessr.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. // Track pressed keys
  16. let controlPressed = false;
  17. let xPressed = false;
  18. let sPressed = false;
  19.  
  20. // Event listener for keydown
  21. document.addEventListener('keydown', (event) => {
  22. if (event.key === 'Control') controlPressed = true;
  23. if (event.key === 'x') xPressed = true;
  24. if (event.key === 's') sPressed = true;
  25.  
  26. // Trigger the action when all keys are pressed
  27. if (controlPressed && xPressed && sPressed) {
  28. // Locate the iframe element by its ID
  29. const iframe = document.querySelector('#PanoramaIframe');
  30. if (iframe) {
  31. const src = iframe.getAttribute('src');
  32. if (src) {
  33. try {
  34. // Parse the URL to extract the `location` parameter
  35. const url = new URL(src);
  36. const location = url.searchParams.get('location'); // Extract "LAT,LONG"
  37. if (location) {
  38. // Open the full Google Maps URL
  39. const mapsUrl = `https://www.google.com/maps?q=${location}`;
  40. window.open(mapsUrl, '_blank');
  41. } else {
  42. console.error('Location parameter not found in iframe URL.');
  43. }
  44. } catch (error) {
  45. console.error('Error parsing iframe URL:', error);
  46. }
  47. } else {
  48. console.error('Iframe src attribute not found.');
  49. }
  50. } else {
  51. console.error('Iframe with ID "PanoramaIframe" not found.');
  52. }
  53.  
  54. // Prevent default browser behavior
  55. event.preventDefault();
  56.  
  57. // Reset keys after action
  58. controlPressed = false;
  59. xPressed = false;
  60. sPressed = false;
  61. }
  62. });
  63.  
  64. // Event listener for keyup to clear pressed keys
  65. document.addEventListener('keyup', (event) => {
  66. if (event.key === 'Control') controlPressed = false;
  67. if (event.key === 'x') xPressed = false;
  68. if (event.key === 's') sPressed = false;
  69. });
  70. })();