-
Notifications
You must be signed in to change notification settings - Fork 30
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
Browserslist entries that have version ranges don't match valid browsers #41
Comments
@litonico did you try |
@onoshkodaniil |
TBH, I'm not sure why I did the Note, however, this issue is still not completely fixed due to a bug in |
Hi. I still see strange behavior in const { matchesUA } = require("browserslist-useragent");
matchesUA("Chrome/77", { browsers: ["defaults"] }); // => return false
matchesUA("Chrome/77.0.3865.75", { browsers: ["defaults"] }); // => but this return true cc @pastelsky |
browserslist
contains entries with version ranges. For instance,browserslist("ios_saf >= 9")
includes the entry'ios_saf 9.0-9.2'
.For that browserslist,
browserslist-useragent
matches onlyios_saf 9.0
. User agents with iOS Safari versions of9.1
or9.2
are never matched.Steps to Repro:
Expected behavior:
matchesUA('Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/74.0.3729.169 Mobile/13B143 Safari/601.1.46', { browsers: ["ios_saf >= 9"] }))
returns
true
Actual behavior:
matchesUA('Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/74.0.3729.169 Mobile/13B143 Safari/601.1.46', { browsers: ["ios_saf >= 9"] }))
returns
false
What's happening:
browserslist-useragent/index.js
Line 158 in 1cbab42
Splitting the string
'ios_saf 9.0-9.2'
and taking the first array element means the only matched version is9.0
.9.1
and9.2
are incorrectly not matched.The text was updated successfully, but these errors were encountered: