原生环境无法使用 URL 对象

我在 windows 平台中使用 URL 对象

let obj = new URL("url string");

结果在这里出了错:

TypeError: Cannot read property 'toLowerCase' of undefined
    at new <anonymous> (jsb-adapter/web-adapter.js:357:35)
    at Function.getRecordData (assets/main/index.b1c91.js:7911:22)
    at LoadingScene.getRecordData (assets/main/index.b1c91.js:1593:17)
    at LoadingScene.onLoad (assets/main/index.b1c91.js:1554:16)
    at eval (eval at createInvokeImplJit (src/cocos-js/cc.c2244.js:29938:69), <anonymous>:3:65)
    at OneOffInvoker._invoke (src/cocos-js/cc.c2244.js:29945:19)
    at OneOffInvoker.invoke (src/cocos-js/cc.c2244.js:29875:22)
    at NodeActivator.activateNode (src/cocos-js/cc.c2244.js:30200:31)
    at Scene._activate (src/cocos-js/cc.c2244.js:28976:48)
    at Director.runSceneImmediate (src/cocos-js/cc.c2244.js:36573:23)

可以看到 uri_info 里面并没有 protocol 属性,这应该是引擎中间有 bug 了

我看到引擎里面原生环境用的都是相同的 web-adapter.js,果然 Android 下也得到了了相同的错误

2022-11-24 17:47:59.870 4271-4390/com.test D/Cocos: 17:47:59 [DEBUG]: D/ JS: [ERROR]: TypeError: Cannot read property 'toLowerCase' of undefined
    TypeError: Cannot read property 'toLowerCase' of undefined
        at new <anonymous> (jsb-adapter/web-adapter.js:357:35)
        at Function.getRecordData (assets/main/index.js:7911:22)
        at LoadingScene.getRecordData (assets/main/index.js:1593:17)
        at LoadingScene.onLoad (assets/main/index.js:1554:16)
        at eval (eval at createInvokeImplJit (src/cocos-js/cc.js:29938:69), <anonymous>:3:65)
        at OneOffInvoker._invoke (src/cocos-js/cc.j

使用的版本是 3.6.2

已在 GitHub 上建立了 issue 13546

1赞