Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

keralinnn
Copy link
Contributor

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
Copy link
Owner

0x978 commented Apr 22, 2024

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!

@0x978 0x978 merged commit f3e68d6 into 0x978:master Apr 22, 2024
@keralinnn keralinnn deleted the fix/mapsFromCoords-not-working-in-firefox branch April 23, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants