原因是该网站没有识别兼容HarmonyOS设备的UA,可通过自定义UA的方式规避该问题,demo如下:import web_webview from '@ohos.web.webview' @Entry @Component struct WebComponent { controller: web_webview.WebviewController = new web_webview.WebviewController() build() { Column() { Web({ src: 'xxx', controller: this.controller }) .domStorageAccess(true) .onControllerAttached(()=>{ // 移动端通用UA this.controller.setCustomUserAgent('Mozilla/5.0 (Linux; xxx; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) xxx/99.0.4844.88 HuaweiBrowser/12.0.4.1 Mobile Safari/537.36') }) } } }参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-webview-V5\#setcustomuseragent10
原因是该网站没有识别兼容HarmonyOS设备的UA,可通过自定义UA的方式规避该问题,demo如下:
参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-webview-V5\#setcustomuseragent10