From cd25ea4b821b05aab7d66140ba163285cee05999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Mileusni=C4=87?= Date: Thu, 12 Sep 2024 20:47:05 +0200 Subject: [PATCH] Blackberry, Yandex --- is.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/is.go b/is.go index a3bf5b3..3fff5a4 100644 --- a/is.go +++ b/is.go @@ -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 {