From 0637a812bcb4c362f32919be52223f6d0e0a0627 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 16 May 2018 22:29:19 +0900 Subject: [PATCH] web: Fix detecting mobile browsers for NodeJS --- internal/web/js.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/web/js.go b/internal/web/js.go index aacb6ea7a..b270635d7 100644 --- a/internal/web/js.go +++ b/internal/web/js.go @@ -40,6 +40,9 @@ func IsBrowser() bool { } func IsIOSSafari() bool { + if IsNodeJS() { + return false + } ua := js.Global.Get("navigator").Get("userAgent").String() if !strings.Contains(ua, "iPhone") { return false @@ -48,6 +51,9 @@ func IsIOSSafari() bool { } func IsAndroidChrome() bool { + if IsNodeJS() { + return false + } ua := js.Global.Get("navigator").Get("userAgent").String() if !strings.Contains(ua, "Android") { return false