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

Add HipChat, fix Slack, and a few browsers on Android. #245

Merged
merged 1 commit into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ user_agent_parsers:
- regex: '(FlyFlow)/(\d+)\.(\d+)'
family_replacement: 'Baidu Explorer'

# MxBrowser is Maxthon. Must go before Mobile Chrome for Android
- regex: '(MxBrowser)/(\d+)\.(\d+)(?:\.(\d+))?'
family_replacement: 'Maxthon'

# Crosswalk must go before Mobile Chrome for Android
- regex: '(Crosswalk)/(\d+)\.(\d+)\.(\d+)\.(\d+)'

# Chrome Mobile
- regex: '(CrMo)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Chrome Mobile'
Expand Down Expand Up @@ -286,16 +293,22 @@ user_agent_parsers:
# AOL Browser (IE-based)
- regex: '(AOL) (\d+)\.(\d+); AOLBuild (\d+)'

# MxBrowser is Maxthon
- regex: '(MxBrowser)/(\d+)\.(\d+)(?:\.(\d+))?'
family_replacement: 'Maxthon'

#### END SPECIAL CASES TOP ####

#### MAIN CASES - this catches > 50% of all browsers ####


# Slack desktop client (needs to be before Apple Mail, Electron, and Chrome as it gets wrongly detected on Mac OS otherwise)
- regex: '(Slack_SSB)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Slack Desktop Client'

# HipChat provides a version on Mac, but not on Windows.
# Needs to be before Chrome on Windows, and AppleMail on Mac.
- regex: '(HipChat)/?(\d+)?'
family_replacement: 'HipChat Desktop Client'

# Browser/major_version.minor_version.beta_version
- regex: '\b(MobileIron|Crosswalk|FireWeb|Jasmine|ANTGalio|Midori|Fresco|Lobo|PaleMoon|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Epiphany|Shiira|Sunrise|Spotify|Flock|Netscape|Lunascape|WebPilot|NetFront|Netfront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|ThunderBrowse|Iris|UP\.Browser|Bunjalloo|Google Earth|Raven for Mac|Openwave|MacOutlook|Electron)/(\d+)\.(\d+)\.(\d+)'
- regex: '\b(MobileIron|FireWeb|Jasmine|ANTGalio|Midori|Fresco|Lobo|PaleMoon|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Epiphany|Shiira|Sunrise|Spotify|Flock|Netscape|Lunascape|WebPilot|NetFront|Netfront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|ThunderBrowse|Iris|UP\.Browser|Bunjalloo|Google Earth|Raven for Mac|Openwave|MacOutlook|Electron)/(\d+)\.(\d+)\.(\d+)'

# Outlook 2007
- regex: 'Microsoft Office Outlook 12\.\d+\.\d+|MSOffice 12'
Expand Down Expand Up @@ -418,9 +431,6 @@ user_agent_parsers:
- regex: '(MSIE) (\d+)\.(\d+).*XBLWP7'
family_replacement: 'IE Large Screen'

# Slack desktop client (needs to be before Apple Mail as it gets wrongly detected on Mac OS otherwise)
- regex: '(Slack_SSB)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Slack Desktop Client'

#### END MAIN CASES ####

Expand Down
36 changes: 36 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6741,6 +6741,12 @@ test_cases:
minor: '43'
patch: '343'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 6.0.1; Z831 Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Crosswalk/11.45.2454.20160425 Mobile Safari/537.36'
family: 'Crosswalk'
major: '11'
minor: '45'
patch: '2454'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 4.1.2; GT-S7710 Build/JZO54K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile'
family: 'Chrome Mobile'
major: '18'
Expand Down Expand Up @@ -6777,6 +6783,30 @@ test_cases:
minor: '0'
patch: '3'

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) AtomShell/2.6.0 Chrome/56.0.2924.87 Electron/1.6.3 Safari/537.36 MacAppStore/16.5.0 Slack_SSB/2.6.0'
family: 'Slack Desktop Client'
major: '2'
minor: '6'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Slack/2.6.0-beta18998559 Chrome/56.0.2924.87 AtomShell/1.6.3 Safari/537.36 Slack_SSB/2.6.0'
family: 'Slack Desktop Client'
major: '2'
minor: '6'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) HipChat/732 (modern)'
family: 'HipChat Desktop Client'
major: '732'
minor:
patch:

- user_agent_string: 'HipChat Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.7.0 Chrome/49.0.2623.111 Safari/537.36'
family: 'HipChat Desktop Client'
major:
minor:
patch:

- user_agent_string: 'Microsoft-CryptoAPI/6.1'
family: 'Microsoft-CryptoAPI'
major: '6'
Expand Down Expand Up @@ -6891,6 +6921,12 @@ test_cases:
minor: '4'
patch: '5'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 7.0; SM-G930P Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 MxBrowser/4.5.10.7000'
family: 'Maxthon'
major: '4'
minor: '5'
patch: '10'

- user_agent_string: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.6 (KHTML, like Gecko) Chrome/18.0.1025.133 Safari/537.6 Midori/0.5'
family: 'Midori'
major: '0'
Expand Down