web: Remove unused functions

This commit is contained in:
Hajime Hoshi 2020-11-21 01:32:51 +09:00
parent 097c8e66e1
commit 5d8c39028c
2 changed files with 2 additions and 19 deletions

View File

@ -24,25 +24,16 @@ func IsBrowser() bool {
} }
var ( var (
userAgent = js.Global().Get("navigator").Get("userAgent").String()
isIOSSafari bool isIOSSafari bool
isAndroidChrome bool isAndroidChrome bool
) )
func init() { func init() {
userAgent := js.Global().Get("navigator").Get("userAgent").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")
} }
func IsIOSSafari() bool {
return isIOSSafari
}
func IsAndroidChrome() bool {
return isAndroidChrome
}
func IsMobileBrowser() bool { func IsMobileBrowser() bool {
return IsIOSSafari() || IsAndroidChrome() return isIOSSafari || isAndroidChrome
} }

View File

@ -20,14 +20,6 @@ func IsBrowser() bool {
return false return false
} }
func IsIOSSafari() bool {
return false
}
func IsAndroidChrome() bool {
return false
}
func IsMobileBrowser() bool { func IsMobileBrowser() bool {
return false return false
} }