mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57: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 {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user