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

Windows_os_version mismatch on windows 10 (chrome) #130

Open
PeterDeSaegher opened this issue Mar 12, 2019 · 0 comments
Open

Windows_os_version mismatch on windows 10 (chrome) #130

PeterDeSaegher opened this issue Mar 12, 2019 · 0 comments
Labels

Comments

@PeterDeSaegher
Copy link

On windows 10 (using chrome browser) the windows_os_version is not correct.

It returns 'Generic windows'.

The reason is an overlapping in the regular expression for windows 10 and windows NT 4:
"WINDOWS_10": /(windows nt 10.0)/
"WINDOWS_NT_4_0": /(windows nt 4.0|winnt4.0|winnt|windows nt)/

Having a useragent-string "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/72.0.3626.121 safari/537.36" both the windows10-regexp as winNt4-regexp passes test.

Is can easily be solved by just adjusting the order in the REG_WINDOWS_OS_VERSION constant in reg-expressions.constants.ts to follow the windows version history. If windows 10 is matched after windows 4 NT the windows_os_version will return the correct version.

Alternatively you could also try to have a more specific regexp but as I am not a expert (is anyone?) it can not make any concrete suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants