From 0245e830a43cdd4a76b0b7181c2e12343786ee8f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 6 Jan 2021 17:37:47 -0700 Subject: [PATCH] quick hack for better Apple M1 Rosetta compat --- _webi/ua-detect.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_webi/ua-detect.js b/_webi/ua-detect.js index 7491677..426db69 100644 --- a/_webi/ua-detect.js +++ b/_webi/ua-detect.js @@ -54,6 +54,10 @@ function getArch(ua) { return '-'; } + // quick hack for Apple Silicon M1 + // Native: Darwin boomer.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64 + // Resetta: Darwin boomer.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 x86_64 + ua = ua.replace(/xnu-.*RELEASE_[^\s]*/, '') if (/aarch64|arm64|arm8|armv8/i.test(ua)) { return 'arm64'; } else if (/aarch|arm7|armv7/i.test(ua)) { -- 2.25.1