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:
3883155
)
still fixing WSL
author
AJ ONeal
<aj@therootcompany.com>
Thu, 9 Jul 2020 17:06:01 +0000
(17:06 +0000)
committer
AJ ONeal
<aj@therootcompany.com>
Thu, 9 Jul 2020 17:06:01 +0000
(17:06 +0000)
_webi/ua-detect.js
patch
|
blob
|
history
diff --git
a/_webi/ua-detect.js
b/_webi/ua-detect.js
index b174fd4acf2d5bf59099876fb91e1cb50b56fea0..89c18c8919d166d71d67aca0b778d8c6b788c6d3 100644
(file)
--- a/
_webi/ua-detect.js
+++ b/
_webi/ua-detect.js
@@
-10,14
+10,17
@@
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 (/
^ms$|Microsoft|Windows|win32|win|PowerShell
/i.test(ua)) {
+ } else if (/
Linux/i.test(ua) && !/cygwin|msysgit
/i.test(ua)) {
// It's the year of the Linux Desktop!
// It's the year of the Linux Desktop!
- // (TODO: what about cygwin / msysgit?)
// See also http://www.mslinux.org/
// 'linux' must be tested before 'Microsoft' because WSL
// See also http://www.mslinux.org/
// 'linux' must be tested before 'Microsoft' because WSL
+ // (TODO: does this affect cygwin / msysgit?)
+ return 'linux';
+ } else if (/^ms$|Microsoft|Windows|win32|win|PowerShell/i.test(ua)) {
// 'win' must be tested after 'darwin'
return 'windows';
} else if (/Linux|curl|wget/i.test(ua)) {
// 'win' must be tested after 'darwin'
return 'windows';
} else if (/Linux|curl|wget/i.test(ua)) {
+ // test 'linux' again, after 'win'
return 'linux';
} else {
return 'error';
return 'linux';
} else {
return 'error';