mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +01:00
web: Fix detecting mobile browsers for NodeJS
This commit is contained in:
parent
a5eb1b84ab
commit
0637a812bc
@ -40,6 +40,9 @@ func IsBrowser() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsIOSSafari() bool {
|
func IsIOSSafari() bool {
|
||||||
|
if IsNodeJS() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
ua := js.Global.Get("navigator").Get("userAgent").String()
|
ua := js.Global.Get("navigator").Get("userAgent").String()
|
||||||
if !strings.Contains(ua, "iPhone") {
|
if !strings.Contains(ua, "iPhone") {
|
||||||
return false
|
return false
|
||||||
@ -48,6 +51,9 @@ func IsIOSSafari() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsAndroidChrome() bool {
|
func IsAndroidChrome() bool {
|
||||||
|
if IsNodeJS() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user