Skip to content

[Webview] DOM storage (localStorage/sessionStorage) disabled on ArkWeb #76

Description

@Islatri

Linked PR

  1. feat(plugin-webview): support domStorageAccess for ArkWeb DOM storage #77

Problem

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions