diff --git a/platforms/minigame/platforms/taobao-mini-game/wrapper/builtin/window.js b/platforms/minigame/platforms/taobao-mini-game/wrapper/builtin/window.js index 0d1b1855898..113592a9740 100644 --- a/platforms/minigame/platforms/taobao-mini-game/wrapper/builtin/window.js +++ b/platforms/minigame/platforms/taobao-mini-game/wrapper/builtin/window.js @@ -13,23 +13,10 @@ export cancelAnimationFrame from './cancelAnimationFrame' export * from './WindowProperties' -const compareVersions = (curVersion, supportedVersion) => { - const curVersionNum = curVersion.split('.').map(Number); - const supportedVersionNum = supportedVersion.split('.').map(Number); - - for (let i = 0; i < Math.max(curVersionNum.length, supportedVersionNum.length); i++) { - const curVersionPart = curVersionNum[i] || 0; - const supportedVersionPart = supportedVersionNum[i] || 0; - if (curVersionPart > supportedVersionPart) return 1; - if (curVersionPart < supportedVersionPart) return -1; - } - return 0; -} - import MultiWebSocket from './MultiWebSocket' import WebSocket from './WebSocket' const systemInfo = my.getSystemInfoSync(); -if (compareVersions(systemInfo.version, '10.35.30') >= 0) { +if (typeof my !== 'undefined' && my && my.canIUse && my.canIUse('connectSocket.object.multiple')) { $global.WebSocket = MultiWebSocket; } else { $global.WebSocket = WebSocket;