Skip to content

Commit

Permalink
feat: add support for Ecosia iOS & Ecosia Android
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarthon committed Oct 25, 2023
1 parent d668d6c commit 6eef3d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ user_agent_parsers:
- regex: '(Tenta/)(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Tenta Browser'

# Ecosia on iOS / Android
- regex: '(Ecosia) ios@(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Ecosia iOS'
- regex: '(Ecosia) android@(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Ecosia Android'

# Chrome Mobile
- regex: 'Version/.{1,300}(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Chrome Mobile WebView'
Expand Down
12 changes: 12 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8681,3 +8681,15 @@ test_cases:
major: '3'
minor: '2'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/605.1.15 (Ecosia [email protected])'
family: 'Ecosia iOS'
major: '8'
minor: '1'
patch: '3'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 9; Redmi 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36 (Ecosia [email protected])'
family: 'Ecosia Android'
major: '101'
minor: '0'
patch: '4951'

0 comments on commit 6eef3d4

Please sign in to comment.