Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-11-26 17:46:42 +00:00
parent 7adccb2e94
commit 295a0b87f7
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
2 changed files with 6 additions and 6 deletions

View file

@ -222,7 +222,7 @@ export default class WebPlatform extends BasePlatform {
url.pathname.replace(/\/$/, ""), // Remove trailing slash if present url.pathname.replace(/\/$/, ""), // Remove trailing slash if present
].join(""); ].join("");
const ua = new UAParser(); const ua = new UAParser(window.navigator.userAgent);
const browserName = ua.getBrowser().name || "unknown browser"; const browserName = ua.getBrowser().name || "unknown browser";
let osName = ua.getOS().name || "unknown OS"; let osName = ua.getOS().name || "unknown OS";
// Stylise the value from the parser to match Apple's current branding. // Stylise the value from the parser to match Apple's current branding.

View file

@ -43,7 +43,7 @@ const ANDROID_EXPECTED_RESULT = [
makeDeviceExtendedInfo(DeviceType.Mobile, "Google (Nexus) (5)", "Android 7.0"), makeDeviceExtendedInfo(DeviceType.Mobile, "Google (Nexus) (5)", "Android 7.0"),
makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-A510F", "Android 6.0.1"), makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-A510F", "Android 6.0.1"),
makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-G610M", "Android 7.0"), makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-G610M", "Android 7.0"),
makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-G973U", "Android 9", "Chrome", "69.0.3497.100"), makeDeviceExtendedInfo(DeviceType.Mobile, "Samsung SM-G973U", "Android 9", "Mobile Chrome", "69.0.3497.100"),
]; ];
const IOS_UA = [ const IOS_UA = [
@ -68,7 +68,7 @@ const DESKTOP_UA = [
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36",
]; ];
const DESKTOP_EXPECTED_RESULT = [ const DESKTOP_EXPECTED_RESULT = [
makeDeviceExtendedInfo(DeviceType.Desktop, "Apple Macintosh", "Mac OS", "Electron", "20.1.1"), makeDeviceExtendedInfo(DeviceType.Desktop, "Apple Macintosh", "macOS", "Electron", "20.1.1"),
makeDeviceExtendedInfo(DeviceType.Desktop, undefined, "Windows", "Electron", "20.1.1"), makeDeviceExtendedInfo(DeviceType.Desktop, undefined, "Windows", "Electron", "20.1.1"),
]; ];
@ -82,10 +82,10 @@ const WEB_UA = [
]; ];
const WEB_EXPECTED_RESULT = [ const WEB_EXPECTED_RESULT = [
makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "Mac OS", "Chrome", "104.0.5112.102"), makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "macOS", "Chrome", "104.0.5112.102"),
makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Chrome", "104.0.5112.102"), makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Chrome", "104.0.5112.102"),
makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "Mac OS", "Firefox", "39.0"), makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "macOS", "Firefox", "39.0"),
makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "Mac OS", "Safari", "8.0.3"), makeDeviceExtendedInfo(DeviceType.Web, "Apple Macintosh", "macOS", "Safari", "8.0.3"),
makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Firefox", "40.0"), makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Firefox", "40.0"),
makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Edge", "12.246"), makeDeviceExtendedInfo(DeviceType.Web, undefined, "Windows", "Edge", "12.246"),
]; ];