Skip to content

Commit

Permalink
fix: parse Edge on iPad OS properly
Browse files Browse the repository at this point in the history
The UA for Edge on iPad OS doesn't specify the full edge version, but only the
major. This changes the regex so that both minor & patch versions are optional.
  • Loading branch information
lbarthon committed Oct 25, 2023
1 parent d668d6c commit aeaa8ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ user_agent_parsers:
# Edge Mobile
- regex: 'Windows Phone .{0,200}(Edge)/(\d+)\.(\d+)'
family_replacement: 'Edge Mobile'
- regex: '(EdgiOS|EdgA)/(\d+)\.(\d+)\.(\d+)(?:\.(\d+)|)'
- regex: '(EdgiOS|EdgA)\/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)'
family_replacement: 'Edge Mobile'

# Oculus Browser, should go before Samsung Internet
Expand Down
6 changes: 6 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8681,3 +8681,9 @@ test_cases:
major: '3'
minor: '2'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) EdgiOS/108 Version/13.0.3 Safari/605.1.15'
family: 'Edge Mobile'
major: '108'
minor:
patch:

0 comments on commit aeaa8ab

Please sign in to comment.