diff --git a/is.go b/is.go index a98bea2..a3bf5b3 100644 --- a/is.go +++ b/is.go @@ -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 +}