browserslist-useragent-ruby
browserslist-useragent-ruby copied to clipboard
Opera Mobile on Android not detected
-
I'm submitting a ...
- [x] bug report
-
What is the current behavior?
matcher.browser?
returnsfalse
even though it is in my .browserlistrc -
What is the expected behavior?
matcher.browser?
should return true -
What is the motivation / use case for changing the behavior? The current behaviour seems incorrect
-
Please tell us about your environment:
- browserslist_useragent (0.2.0) in a Rails 6.0.3.2 app
- Opera Mobile 59.1.2926.54067 running on Android (https://play.google.com/store/apps/details?id=com.opera.browser&hl=en)
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) Seems to fail because of a whitespace:
30: def browser?
31: target_browser = user_agent[:family].downcase
=> 32: queries.key?(target_browser)
33: end
[1] pry(#<BrowserslistUseragent::Match>)> target_browser
=> "opera mobile"
[2] pry(#<BrowserslistUseragent::Match>)> queries
=> {"chrome"=>["81", "83", "81", "80"],
"firefox"=>["68", "78", "77", "76", "68"],
"qqandroid"=>["10.4"],
"ucandroid"=>["12.12"],
"android"=>["81"],
"baidu"=>["7.12"],
"edge"=>["83", "81", "18"],
"ios"=>["13.4-13.5", "13.3", "12.2-12.4"],
"kaios"=>["2.5"],
"operamini"=>["all"],
"operamobile"=>["46"],
"opera"=>["69", "68"],
"safari"=>["13.1", "13"],
"samsung"=>["12.0", "11.1-11.2"]}
A potential solution could be to adjust the resolver.rb to handle opera mobile.