加载WebView页面报错"Can not read properties of null (reading 'getltem')"

加载WebView页面报错"Can not read properties of null (reading 'getltem')"

HarmonyOS
2024-07-05 18:44:13
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
海不辞水

在加载webview的controller中加入.domStorageAccess(true)

示例代码

 build() {
    Column() {
      Row().width('100%').height('50rpx')
      Web({ src: src, controller: this.controller })
        .javaScriptAccess(true)
        .domStorageAccess(true)
    }
  }
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
分享
微博
QQ
微信
回复
2024-07-06 11:23:31
相关问题
webview加载url后页面一片空白,无报错
4028浏览 • 1回复 待解决
HarmonyOS webview加载页面空白
907浏览 • 1回复 待解决
HarmonyOS webview加载页面时会加载两遍
796浏览 • 1回复 待解决
Webview加载报错-net::ERR_NAME_NOT_RESOLVED
14799浏览 • 3回复 待解决
WebView页面加载错误回调能力。
1642浏览 • 1回复 待解决
HarmonyOS webview加载页面无法显示
1778浏览 • 1回复 待解决
HarmonyOS H5页面localstorage为null
960浏览 • 1回复 待解决