Skip to content

Commit

Permalink
feat: support GNOME Web (#22)
Browse files Browse the repository at this point in the history
* feat: support GNOME Web

* chore: add comments

---------

Co-authored-by: dangreen <danon0404@gmail.com>
  • Loading branch information
dargmuesli and dangreen committed Dec 1, 2023
1 parent 2d0c533 commit 2c7c69e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export const regexes = [
/**
* Safari on iPad have desktop-like useragent
* Some versions contains letter subversions
* GNOME Web (X11) is based on WebKit and should be detected as Safari
*/
{
regex: /Maci.+ Version\/(\d+)\.(\d+)([.,](\d+)|)( \(\w+\)|)( Mobile\/\w+|) Safari\//,
regex: /(Maci|X11).+ Version\/(\d+)\.(\d+)([.,](\d+)|)( \(\w+\)|)( Mobile\/\w+|) Safari\//,
family: 'safari'
},
/**
Expand Down
7 changes: 7 additions & 0 deletions test/useragents.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ export const useragents = [
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
regex: ['chrome', 'chrome@<=70']
},
/**
* GNOME Web
*/
{
ua: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15',
regex: ['safari']
},
/**
* Safari Desktop
*/
Expand Down

0 comments on commit 2c7c69e

Please sign in to comment.