0x978 / GeoGuessr_Resolver

A script which returns the correct location in Geoguessr
https://greasyfork.org/en/scripts/450253-geoguessr-resolver-hack-7-5-duels-and-google-maps-update
48 stars 7 forks source link

Fix for mapsFromCoords function doesn't work in Firefox #24

Closed keralinnn closed 6 months ago

keralinnn commented 6 months ago

For some reason, in Chromium-based and Firefox-based browsers, the conversion of a function into a string works differently, so when we try to get the index of 'native code' we get different results. The best approach would be, of course, to use regex or to somehow parse it other way, but it feels like that is unnecessary, because the result of nativeOpen.toString().indexOf('native code') is always either 19 for Chrome or 23 for Firefox:

// nativeOpen.toString() in Chromium-based browsers
function open() { [native code] }
// nativeOpen.toString() in Firefox-based browsers
function open() {
    [native code]
}
0x978 commented 6 months ago

Huh odd, I have never received complaint that the script doesn't work in Firefox so I always presumed it had, thanks for the fix!