web: Bug fix: Expose IsAndroidChrome

This commit is contained in:
Hajime Hoshi 2017-12-17 01:22:22 +09:00
parent 7cd89bc44b
commit 9471e3e4e7
2 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ func IsIOSSafari() bool {
return true return true
} }
func isAndroidChrome() bool { func IsAndroidChrome() bool {
ua := js.Global.Get("navigator").Get("userAgent").String() ua := js.Global.Get("navigator").Get("userAgent").String()
if !strings.Contains(ua, "Android") { if !strings.Contains(ua, "Android") {
return false return false
@ -50,5 +50,5 @@ func isAndroidChrome() bool {
} }
func IsMobileBrowser() bool { func IsMobileBrowser() bool {
return IsIOSSafari() || isAndroidChrome() return IsIOSSafari() || IsAndroidChrome()
} }

View File

@ -28,6 +28,10 @@ func IsIOSSafari() bool {
return false return false
} }
func IsAndroidChrome() bool {
return false
}
func IsMobileBrowser() bool { func IsMobileBrowser() bool {
return false return false
} }