Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Conversation

@Vasfed
Copy link
Contributor

@Vasfed Vasfed commented Mar 16, 2018

Yandex browser is relatively popular in russian-speaking countries. It is based on Blink engine thus in terms of rendering is equal to Chrome.

Until it becomes available on caniuse we may map it to chrome versions that are reported in user agent string and make stats coverage more useable.

@Vasfed Vasfed force-pushed the feature/yabrowser_mapping branch from 6a7d97a to ac3d9eb Compare March 16, 2018 16:57
@Vasfed Vasfed force-pushed the feature/yabrowser_mapping branch from ac3d9eb to 02ec8c7 Compare March 16, 2018 17:02
@dmfrancisco
Copy link
Member

This is great, thank you for your contribution 👏

Can you provide more context about how you got to that mapping? Right now all the browser version updates come from caniuse-lite but with this change we would have to manually keep this mapping file updated too, and so it's important to me to learn how easy that process is.

@Vasfed
Copy link
Contributor Author

Vasfed commented Mar 17, 2018

@dmfrancisco I have parsed that from my production system recent access logs (~6M hits), user agent strings look like
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 YaBrowser/14.8.1985.11875 Safari/537.36 (it's exactly Chrome user agent with addition of YaBrowser/[0-9.]+ (in this example we see YaBrowser 14.8 == Chrome 36, which gives [14, 8, 36] mapping, mappings are sorted for easier search. On iOS safari is used (thus other PR) and on android it looks like it uses either same version or newer

Mapping does not need to be 100% accurate - in worst case user will only get slightly elevated usage of middle-range chrome versions (closest known mapping is used). With this patch on my usage I managed to go from 83% stats coverage to 96% (npx browserslist --coverage="my stats" "cover 100% in my stats", browserslist >= 3.2)

@dmfrancisco
Copy link
Member

This looks good 👍 Thank you again!

@dmfrancisco dmfrancisco merged commit fca8b84 into browserslist:master Mar 18, 2018
@dmfrancisco
Copy link
Member

dmfrancisco commented Mar 18, 2018

It seems it may be more appropriate to map "YaBrowser for Android" to "Chrome for Android", so I'll add that change too. The versions are the same so the mapping works for both. Because caniuse only tracks the latest version of Chrome for Android, the coverage may decrease a bit.

@dmfrancisco
Copy link
Member

Ended up moving this code to a separate repository and followed the same approach for the Cốc Cốc Browser, a popular browser in Vietnam that I noticed frequently in the JS.coach analytics.

The repository is available here: https://github.com/dmfrancisco/map-to-chrome

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants