2
0

Blackberry, Yandex

This commit is contained in:
Miloš Mileusnić
2024-09-12 20:47:05 +02:00
parent 9b786e15fc
commit cd25ea4b82
+15
View File
@@ -30,6 +30,11 @@ func (ua UserAgent) IsChromeOS() bool {
return ua.OS == ChromeOS || ua.OS == "CrOS"
}
// IsBlackberryOS shorthand function to check if OS == BlackBerry
func (ua UserAgent) IsBlackberryOS() bool {
return ua.OS == BlackBerry
}
// IsOpera shorthand function to check if Name == Opera
func (ua UserAgent) IsOpera() bool {
return ua.Name == Opera
@@ -65,6 +70,11 @@ func (ua UserAgent) IsEdge() bool {
return ua.Name == Edge
}
// IsBlackBerry shorthand function to check if Name == BlackBerry
func (ua UserAgent) IsBlackBerry() bool {
return ua.Name == BlackBerry
}
// IsGooglebot shorthand function to check if Name == Googlebot
func (ua UserAgent) IsGooglebot() bool {
return ua.Name == Googlebot
@@ -80,6 +90,11 @@ func (ua UserAgent) IsFacebookbot() bool {
return ua.Name == FacebookExternalHit
}
// IsYandexbot shorthand function to check if Name == YandexBot
func (ua UserAgent) IsYandexbot() bool {
return ua.Name == YandexBot
}
// IsUnknown returns true if the package can't determine the user agent reliably.
// Fields like Name, OS, etc. might still have values.
func (ua UserAgent) IsUnknown() bool {