2
0

close #23; Add IsUnknown function

This commit is contained in:
Miloš Mileusnić
2023-09-16 13:47:31 +02:00
parent 905f16afeb
commit b781054abd
+6
View File
@@ -79,3 +79,9 @@ func (ua UserAgent) IsTwitterbot() bool {
func (ua UserAgent) IsFacebookbot() bool {
return ua.Name == FacebookExternalHit
}
// 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 {
return !ua.Mobile && !ua.Tablet && !ua.Desktop && !ua.Bot
}