fix(browser): pass radix 10 when parsing Chrome major version
Wheel event DPR factoring parses Chrome/(\d+) with parseInt without a radix. Add base 10 explicitly, matching getSafariVersion and other version parsing in the codebase. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -217,7 +217,7 @@ export class StandardWheelEvent {
|
||||
let shouldFactorDPR: boolean = false;
|
||||
if (platform.isChrome) {
|
||||
const chromeVersionMatch = navigator.userAgent.match(/Chrome\/(\d+)/);
|
||||
const chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;
|
||||
const chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1], 10) : 123;
|
||||
shouldFactorDPR = chromeMajorVersion <= 122;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user