From 1a7a851e3fa8779ce488db62c7c24255b906044c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 9 Jul 2020 03:39:45 +0000 Subject: [PATCH] another WSL matching fix --- _webi/ua-detect.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_webi/ua-detect.js b/_webi/ua-detect.js index 27d772a..5455d6c 100644 --- 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'; + } 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'; -- 2.25.1