diff --git a/lib/Device.ts b/lib/Device.ts index 1100cb45..580965d1 100644 --- a/lib/Device.ts +++ b/lib/Device.ts @@ -9,12 +9,20 @@ type DeviceInfo = { function getOSAndName(): DeviceInfo { const parser = new UAParser(); - const result = parser.getResult(); + const {browser, os} = parser.getResult(); + + let osVersion = os.version; + // Detection logic inspired by UAParser guide on iOS 26: + // https://docs.uaparser.dev/guides/how-to-detect-ios-26-using-javascript.html + if (browser.name === 'Mobile Safari' && browser.major === '26' && os.name === 'iOS' && os.version === '18.6') { + osVersion = '26'; + } + return { - os: result.os.name, - osVersion: result.os.version, - deviceName: result.browser.name, - deviceVersion: result.browser.version, + os: os.name, + osVersion, + deviceName: browser.name, + deviceVersion: browser.version, }; }