Skip to content
This repository was archived by the owner on Jul 19, 2018. It is now read-only.

Commit

Permalink
Merge pull request #222 from 3rd-Eden/master
Browse files Browse the repository at this point in the history
Support for Phantomjs and IE 11
  • Loading branch information
tobie committed Apr 19, 2013
2 parents 30d68d7 + f1cbf19 commit ba83ed9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ user_agent_parsers:
- regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+))?'
family_replacement: 'Amazon Silk'

# Phantomjs, should go before Safari
- regex: '(PhantomJS)/(\d+)\.(\d+)\.(\d+)'

# WebKit Nightly
- regex: '(AppleWebKit)/(\d+)\.?(\d+)?\+ .* Safari'
family_replacement: 'WebKit Nightly'
Expand All @@ -376,7 +379,7 @@ user_agent_parsers:
- regex: '(Phantom)/V(\d+)\.(\d+)'
family_replacement: 'Phantom Browser'

- regex: '(MSIE) (\d+)\.(\d+)'
- regex: '([MS]?IE) (\d+)\.(\d+)'
family_replacement: 'IE'

- regex: '(python-requests)/(\d+)\.(\d+)'
Expand Down
12 changes: 12 additions & 0 deletions test_resources/test_user_agent_parser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -837,3 +837,15 @@ test_cases:
major:
minor:
patch:

- user_agent_string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.6.0 Safari/534.34'
family: 'PhantomJS'
major: '1'
minor: '6'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko'
family: 'IE'
major: '11'
minor: '0'
patch:

0 comments on commit ba83ed9

Please sign in to comment.