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 Sailfish OS and Sailfish Browser (#391) #392

Merged
merged 1 commit into from
Mar 19, 2019
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
6 changes: 5 additions & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ user_agent_parsers:
# must go before Firefox to catch Chimera/SeaMonkey/Camino/Waterfox
- regex: '(Chimera|SeaMonkey|Camino|Waterfox)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*|)'

# must be before Firefox / Gecko to catch SailfishBrowser properly
- regex: '(SailfishBrowser)/(\d+)\.(\d+)(?:\.(\d+)|)'
family_replacement: 'Sailfish Browser'

# Social Networks
# Facebook Messenger must go before Facebook
- regex: '\[(FBAN/MessengerForiOS|FB_IAB/MESSENGER);FBAV/(\d+)(?:\.(\d+)(?:\.(\d+)|)|)'
Expand Down Expand Up @@ -1443,7 +1447,7 @@ os_parsers:
# Generic patterns
# since the majority of os cases are very specific, these go last
##########
- regex: '(Fedora|Red Hat|PCLinuxOS|Puppy|Ubuntu|Kindle|Bada|Lubuntu|BackTrack|Slackware|(?:Free|Open|Net|\b)BSD)[/ ](\d+)\.(\d+)(?:\.(\d+)|)(?:\.(\d+)|)'
- regex: '(Fedora|Red Hat|PCLinuxOS|Puppy|Ubuntu|Kindle|Bada|Sailfish|Lubuntu|BackTrack|Slackware|(?:Free|Open|Net|\b)BSD)[/ ](\d+)\.(\d+)(?:\.(\d+)|)(?:\.(\d+)|)'

# Gentoo Linux + Kernel Version
- regex: '(Linux)[ /](\d+)\.(\d+)(?:\.(\d+)|).*gentoo'
Expand Down
7 changes: 7 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,13 @@ test_cases:
patch:
patch_minor:

- user_agent_string: 'Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0'
family: 'Sailfish'
major: '3'
minor: '0'
patch:
patch_minor:

# up market model
- user_agent_string: 'HbbTV/1.1.1 (;Samsung;SmartTV2013;T-FXPDEUC-1102.2;;) WebKit'
family: 'Samsung'
Expand Down
12 changes: 12 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3984,6 +3984,18 @@ test_cases:
minor: '7'
patch:

- user_agent_string: 'Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0'
family: 'Sailfish Browser'
major: '1'
minor: '0'
patch:

- user_agent_string: 'Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.2.3'
family: 'Sailfish Browser'
major: '1'
minor: '2'
patch: '3'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 5.0.1; SAMSUNG GT-I9506-ORANGE Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/34.0.1847.76 Mobile Safari/537.36'
family: 'Samsung Internet'
major: '2'
Expand Down