projects
/
webi-installers
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
debcee7
)
another WSL matching fix
author
AJ ONeal
<aj@therootcompany.com>
Thu, 9 Jul 2020 03:39:45 +0000
(
03:39
+0000)
committer
AJ ONeal
<aj@therootcompany.com>
Thu, 9 Jul 2020 03:39:45 +0000
(
03:39
+0000)
_webi/ua-detect.js
patch
|
blob
|
history
diff --git
a/_webi/ua-detect.js
b/_webi/ua-detect.js
index 27d772a7113a3bfb25a78b8e7fea2c045b3b0868..5455d6cf17bc11276f87d2b201747691ad6545f5 100644
(file)
--- a/
_webi/ua-detect.js
+++ b/
_webi/ua-detect.js
@@
-10,6
+10,12
@@
function getOs(ua) {
return 'android';
} else if (/iOS|iPhone|Macintosh|Darwin|OS\s*X|macOS|mac/i.test(ua)) {
return 'macos';
return 'android';
} else if (/iOS|iPhone|Macintosh|Darwin|OS\s*X|macOS|mac/i.test(ua)) {
return 'macos';
+ } else if (/Microsoft\s*Linux/i.test(ua)) {
+ // It's the year of the Linux Desktop!
+ // WSL / WSL2
+ // (checking linux twice because I'm not sure about cygwin / msysgit)
+ // See also http://www.mslinux.org/
+ return 'linux';
} else if (/^ms$|Microsoft|Windows|win32|win|PowerShell/i.test(ua)) {
// 'win' must be tested after 'darwin'
return 'windows';
} else if (/^ms$|Microsoft|Windows|win32|win|PowerShell/i.test(ua)) {
// 'win' must be tested after 'darwin'
return 'windows';