Last active
May 9, 2025 14:09
-
-
Save Delivator/335f7a00a52b358e5398acdaf259bfb3 to your computer and use it in GitHub Desktop.
Fixes a bug where google streetview laggs horribly on 3rd party websites like Geotastic or geoguessr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Geotastic/guessr lag fix on Firefox Linux | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Spoofs a Chromium-based user agent for geotastic.net and geoguessr.com to potentially improve performance. | |
// @author Google Gemini 2.5 Pro | |
// @match *://geotastic.net/* | |
// @match *://www.geotastic.net/* | |
// @match *://geoguessr.com/* | |
// @match *://www.geoguessr.com/* | |
// @run-at document-start | |
// @grant none | |
// @updateURL https://gist.github.com/Delivator/335f7a00a52b358e5398acdaf259bfb3/raw/geogame-firefox-lag-fix.user.js | |
// @downloadURL https://gist.github.com/Delivator/335f7a00a52b358e5398acdaf259bfb3/raw/geogame-firefox-lag-fix.user.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// A common Chromium-based user agent string (e.g., from a recent version of Chrome on Windows) | |
// You can update this to a more current one if needed by searching for "my user agent" in a Chrome browser. | |
const chromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"; | |
// Override the navigator.userAgent property | |
Object.defineProperty(navigator, 'userAgent', { | |
value: chromeUserAgent, | |
writable: false, | |
configurable: false | |
}); | |
// Some sites might also check other navigator properties related to the user agent. | |
// For a more thorough spoof, you might consider also spoofing these if issues persist: | |
// Object.defineProperty(navigator, 'appVersion', { value: chromeUserAgent.replace('Mozilla/5.0 (','').replace(')',''), writable: false, configurable: false }); | |
// Object.defineProperty(navigator, 'vendor', { value: 'Google Inc.', writable: false, configurable: false }); | |
// Object.defineProperty(navigator, 'platform', { value: 'Win32', writable: false, configurable: false }); // Example platform | |
// For sites using User-Agent Client Hints (less common for this type of issue, but possible) | |
// This is more complex to spoof comprehensively with just a userscript. | |
// if (navigator.userAgentData) { | |
// Object.defineProperty(navigator, 'userAgentData', { | |
// value: { | |
// brands: [ | |
// { brand: " Not A;Brand", version: "99" }, | |
// { brand: "Chromium", version: "123" }, | |
// { brand: "Google Chrome", version: "123" } | |
// ], | |
// mobile: false, | |
// platform: "Windows" | |
// // You might need to fill in getHighEntropyValues as well, which is async | |
// }, | |
// writable: false, | |
// configurable: false | |
// }); | |
// } | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment