webview某些url加载空白,链接本身没问题咋回事?

struct WebComponent {
  @State webBusiness: webBusinessToH5 = new webBusinessToH5();
  webviewController: web_web.WebviewController = new web_web.WebviewController();
   url: string = 'https://h5test.ichangtou.com/research/ichangtou/ict-h5-bridge-app/index.html';
    // url: string = 'https://www.baidu.com';

  build() {
    Column() {

      Web({ src: this.url, controller: this.webviewController})

      .onPageEnd((event) => {
        // 注册事件
        this.webviewController.registerJavaScriptProxy(this.webBusiness, "webBusinessToH5", ["test", "getUserInfo"]);
      })
        
    }
  }



}
程序框架
2024-04-12 14:14:21
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Caesa

加上下面这个试试

.domStorageAccess(true)

白屏的很大原因是网页用到了h5用的数据存储功能,而鸿蒙Web组件默认禁止了。

分享
微博
QQ
微信
回复
2024-04-12 16:17:30
相关问题
webview加载url后页面一片空白,无报错
3368浏览 • 1回复 待解决
HarmonyOS webview加载页面空白
445浏览 • 1回复 待解决
HarmonyOS Web组件加载URL显示空白
490浏览 • 1回复 待解决
HarmonyOS webview加载url白屏
461浏览 • 1回复 待解决
HarmonyOS WebView加载url无法滚动
425浏览 • 1回复 待解决
鸿蒙Webview加载Url,alipay无法返回
9642浏览 • 1回复 待解决
HarmonyOS webview加载数据问题
451浏览 • 1回复 待解决
HarmonyOS webview加载本地html问题
1205浏览 • 1回复 待解决
HarmonyOS webview组件内容显示空白
296浏览 • 1回复 待解决