mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/web: Consider the case when navigator exists but userAgent doesn't
This can happen on go2cpp.
This commit is contained in:
parent
0b30ed5959
commit
ec843ce92c
@ -33,7 +33,11 @@ func init() {
|
|||||||
if !nav.Truthy() {
|
if !nav.Truthy() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
userAgent := nav.Get("userAgent").String()
|
ua := nav.Get("userAgent")
|
||||||
|
if !ua.Truthy() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
userAgent := ua.String()
|
||||||
isIOSSafari = strings.Contains(userAgent, "iPhone") || strings.Contains(userAgent, "iPad")
|
isIOSSafari = strings.Contains(userAgent, "iPhone") || strings.Contains(userAgent, "iPad")
|
||||||
isAndroidChrome = strings.Contains(userAgent, "Android") && strings.Contains(userAgent, "Chrome")
|
isAndroidChrome = strings.Contains(userAgent, "Android") && strings.Contains(userAgent, "Chrome")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user