Skip to content

Commit

Permalink
Merge pull request #392 from rainemak/sailfish
Browse files Browse the repository at this point in the history
Add Sailfish OS and Sailfish Browser (#391)
  • Loading branch information
commenthol authored Mar 19, 2019
2 parents b4a50d0 + 8794bab commit 814f6d6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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 @@ -1447,7 +1451,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 @@ -3990,6 +3990,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

0 comments on commit 814f6d6

Please sign in to comment.