You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArkWeb disables DOM storage by default unless .domStorageAccess(true) is
explicitly set on the Web() component. The ohos.webview plugin never sets
it, so:
window.localStorage / sessionStorage are null
frontends throw Cannot read properties of null (white screen)
token / settings / history cannot be persisted
Android and iOS WebViews enable DOM storage by default, so this is a platform
gap every webview consumer hits on OpenHarmony.
Proposed change
Add a dom_storage_access option to WebviewCreateRequest, thread it through
the named N-API ohos.webview.CreateRequest into the ArkTS WebviewPlugin,
and call .domStorageAccess(...) on the Web() component — defaulting to
enabled to match Android/iOS.
Linked PR
Problem
ArkWeb disables DOM storage by default unless
.domStorageAccess(true)isexplicitly set on the
Web()component. Theohos.webviewplugin never setsit, so:
window.localStorage/sessionStoragearenullCannot read properties of null(white screen)Android and iOS WebViews enable DOM storage by default, so this is a platform
gap every webview consumer hits on OpenHarmony.
Proposed change
Add a
dom_storage_accessoption toWebviewCreateRequest, thread it throughthe named N-API
ohos.webview.CreateRequestinto the ArkTSWebviewPlugin,and call
.domStorageAccess(...)on theWeb()component — defaulting toenabled to match Android/iOS.
Affected
crates/plugin-webview/src/lib.rs(Rust facade)plugins/webview/src/main/ets/WebviewPlugin.ets(ArkTS HAR)References
arkts-basic-components-web-attributes.md