Skip to content

Commit

Permalink
fix: safari version can contain letter
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Jul 17, 2023
1 parent 41eb755 commit 6c56b82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export const regexes = [
},
/**
* Safari on iPad have desktop-like useragent
* Some versions contains letter subversions
*/
{
regex: /Maci.+ Version\/(\d+)\.(\d+)([.,](\d+)|)( Mobile\/\w+|) Safari\//,
regex: /Maci.+ Version\/(\d+)\.(\d+)([.,](\d+)|)( \(\w+\)|)( Mobile\/\w+|) Safari\//,
family: 'safari'
},
/**
Expand Down
5 changes: 5 additions & 0 deletions test/useragents.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ export const useragents = [
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15',
regex: ['safari']
},
{
// Letter subversion
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 (a) Safari/605.1.15',
regex: ['safari']
},
/**
* Safari iPad Desktop-like
*/
Expand Down

0 comments on commit 6c56b82

Please sign in to comment.