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"]);
      })
        
    }
  }



}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
程序框架
2024-04-12 14:14:21
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Caesa

加上下面这个试试

.domStorageAccess(true)
  • 1.

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

分享
微博
QQ
微信
回复
2024-04-12 16:17:30


相关问题
webview加载url后页面一片空白,无报错
3656浏览 • 1回复 待解决
HarmonyOS webview加载页面空白
722浏览 • 1回复 待解决
HarmonyOS Web组件加载URL显示空白
675浏览 • 1回复 待解决
HarmonyOS webview加载url白屏
754浏览 • 1回复 待解决
HarmonyOS WebView加载url无法滚动
589浏览 • 1回复 待解决
鸿蒙Webview加载Url,alipay无法返回
9866浏览 • 1回复 待解决
HarmonyOS webview加载数据问题
661浏览 • 1回复 待解决
HarmonyOS webview加载本地html问题
1592浏览 • 1回复 待解决
HarmonyOS webview组件内容显示空白
564浏览 • 1回复 待解决