Skip to content

Commit 2c7c69e

Browse files
dargmueslidangreen
andauthored
feat: support GNOME Web (#22)
* feat: support GNOME Web * chore: add comments --------- Co-authored-by: dangreen <danon0404@gmail.com>
1 parent 2d0c533 commit 2c7c69e

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ export const regexes = [
8080
/**
8181
* Safari on iPad have desktop-like useragent
8282
* Some versions contains letter subversions
83+
* GNOME Web (X11) is based on WebKit and should be detected as Safari
8384
*/
8485
{
85-
regex: /Maci.+ Version\/(\d+)\.(\d+)([.,](\d+)|)( \(\w+\)|)( Mobile\/\w+|) Safari\//,
86+
regex: /(Maci|X11).+ Version\/(\d+)\.(\d+)([.,](\d+)|)( \(\w+\)|)( Mobile\/\w+|) Safari\//,
8687
family: 'safari'
8788
},
8889
/**

test/useragents.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ export const useragents = [
149149
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
150150
regex: ['chrome', 'chrome@<=70']
151151
},
152+
/**
153+
* GNOME Web
154+
*/
155+
{
156+
ua: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15',
157+
regex: ['safari']
158+
},
152159
/**
153160
* Safari Desktop
154161
*/

0 commit comments

Comments
 (0)