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

Detect AppleNews with correct WebKit version #283

Merged
merged 2 commits into from
Nov 28, 2017
Merged

Detect AppleNews with correct WebKit version #283

merged 2 commits into from
Nov 28, 2017

Conversation

JakeChampion
Copy link
Contributor

@JakeChampion JakeChampion commented Nov 27, 2017

Currently, uap-core detects the AppleNews user-agent string with the correct family but incorrect version.

I am using the useragent npm module to return the detections, that module uses uap-core under the hood.

Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) AppleNews/608.0.1 Version/2.0.1

Is detected as

Mobile Safari UI/WKWebView 2.0.1 / iOS 10.0.2

This PR aims to detect it as

Mobile Safari UI/WKWebView 10.0.2 / iOS 10.0.2

Copy link

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it - the regex returns [iPhone] [10] [0] [2] and I guess family_replacement does the trick to replace iPhone with Mobile Safari UI/WKWebView.

👍

@triblondon
Copy link
Contributor

I rather unwittingly have push rights on this repo so am merging. With great power...

@triblondon triblondon merged commit fe08118 into ua-parser:master Nov 28, 2017
@JakeChampion JakeChampion deleted the applenews branch November 28, 2017 17:39
@gu-stav
Copy link

gu-stav commented Nov 28, 2017

@triblondon Thanks!

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

Successfully merging this pull request may close these issues.

3 participants