Skip to content

Commit a0cc4ca

Browse files
committed
up2k-cli: enable mt if chrome 107 or later
1 parent 2701108 commit a0cc4ca

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

copyparty/web/up2k.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ function up2k_init(subtle) {
865865
bcfg_bind(uc, 'turbo', 'u2turbo', turbolvl > 1, draw_turbo);
866866
bcfg_bind(uc, 'datechk', 'u2tdate', turbolvl < 3, null);
867867
bcfg_bind(uc, 'az', 'u2sort', u2sort.indexOf('n') + 1, set_u2sort);
868-
bcfg_bind(uc, 'hashw', 'hashw', !!window.WebAssembly && (!subtle || !CHROME || MOBILE), set_hashw);
868+
bcfg_bind(uc, 'hashw', 'hashw', !!window.WebAssembly && (!subtle || !CHROME || MOBILE || VCHROME >= 107), set_hashw);
869869
bcfg_bind(uc, 'upnag', 'upnag', false, set_upnag);
870870
bcfg_bind(uc, 'upsfx', 'upsfx', false);
871871

copyparty/web/util.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var wah = '',
1414
TOUCH = 'ontouchstart' in window,
1515
MOBILE = TOUCH,
1616
CHROME = !!window.chrome,
17+
VCHROME = CHROME ? 1 : 0,
1718
FIREFOX = ('netscape' in window) && / rv:/.test(navigator.userAgent),
1819
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(navigator.userAgent),
1920
WINDOWS = navigator.platform ? navigator.platform == 'Win32' : /Windows/.test(navigator.userAgent);
@@ -36,8 +37,13 @@ try {
3637
if (navigator.userAgentData.platform == 'Windows')
3738
WINDOWS = true;
3839

39-
if (navigator.userAgentData.brands.some(function (d) { return d.brand == 'Chromium' }))
40-
CHROME = true;
40+
CHROME = navigator.userAgentData.brands.find(function (d) { return d.brand == 'Chromium' });
41+
if (CHROME)
42+
VCHROME = CHROME.version;
43+
else
44+
VCHROME = 0;
45+
46+
CHROME = !!CHROME;
4147
}
4248
catch (ex) { }
4349

0 commit comments

Comments
 (0)