From 53cc9bf769d03c14a0cdc9a305c1e8e7121771b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Mileusni=C4=87?= Date: Thu, 28 Jul 2022 20:27:01 +0200 Subject: [PATCH] Added IsChromeOS --- is.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/is.go b/is.go index d312b24..a98bea2 100644 --- a/is.go +++ b/is.go @@ -1,4 +1,4 @@ -package ua +package useragent // IsWindows shorthand function to check if OS == Windows func (ua UserAgent) IsWindows() bool { @@ -25,6 +25,11 @@ func (ua UserAgent) IsLinux() bool { return ua.OS == Linux } +// IsChromeOS shorthand function to check if OS == CrOS +func (ua UserAgent) IsChromeOS() bool { + return ua.OS == ChromeOS || ua.OS == "CrOS" +} + // IsOpera shorthand function to check if Name == Opera func (ua UserAgent) IsOpera() bool { return ua.Name == Opera