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

Why is Gecko version used for the Firefox user agent? #80

Open
rdsedmundo opened this issue Oct 2, 2023 · 3 comments
Open

Why is Gecko version used for the Firefox user agent? #80

rdsedmundo opened this issue Oct 2, 2023 · 3 comments

Comments

@rdsedmundo
Copy link

rdsedmundo commented Oct 2, 2023

// Use engine version for gecko-based browsers
if (parsedUA.engine.name === 'Gecko') {
return {
family: 'Firefox',
version: parsedEngineVersion
}
}

I'm using Firefox 118.0.1 with user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0.

My browserslist query is as follows:

">0.3%",
"not dead",
"not op_mini all",
"not ie 11"

Which returns, as of now, the following browsers:

'and_chr 115',       'and_uc 15.5',
'chrome 115',        'chrome 114',
'chrome 113',        'chrome 109',
'edge 115',          'edge 114',
'firefox 115',       'firefox 114',
'ios_saf 16.5',      'ios_saf 16.4',
'ios_saf 16.3',      'ios_saf 16.2',
'ios_saf 16.1',      'ios_saf 16.0',
'ios_saf 15.6-15.7', 'ios_saf 14.5-14.8',
'opera 100',         'opera 99',
'safari 16.5',       'safari 16.3',
'safari 15.6',       'samsung 21'

The browserslist-useragent package thinks my Firefox is 109.0 (the Gecko version) instead of 118.0 (I have allowHigherVersions set), so it detects my browser as not supported. This doesn't seem right.

@rdsedmundo
Copy link
Author

@tunailgaz
Copy link

ye I was also confused then saw this issue, I guess we need something like that until it resolves
for my case Fireforx 115 117 and >118 is fine
ua-parser-js's getBrowser() functions gives the right firefox version at the moment.

import Parser from 'ua-parser-js'


const ua_browser = ua.getBrowser()
const hacky_solution = ua_browser.name ===  'Firefox' &&
  (Number(ua_browser.version) === 115 || Number(ua_browser.version) === 117 || Number(ua_browser.version) >= 118)

@reckter
Copy link

reckter commented Oct 23, 2023

This just came up for us, because the newest firefox version 118, will be detected as 109, which is no longer included in the defaults browserslist configuration. (looking at the output of browserslist default I am not sure, why this didn't come up earlier for us, but ¯_(ツ)_/¯

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

No branches or pull requests

3 participants