1

我有一个应用程序,在我的应用程序中有两个 webviews,我标记了 webview_One 和 webview_Two。

webview_One access "http://localhost:12345:/a/index.html"
webview_Two access "http://localhost:12345:/b/index.html"

在 a/index.html 和 b/index.html 中,我使用 localStorage 来操作一个变量,它们都是 localStorage.test,但是,当我在 a/index.html 中更改 localStorage.test 时,在 b/index.html 中我得到的值是在 a/index.html 中进行了更改

为什么每个webview都不能存储localStorage?

我想知道如何让每个 webview 存储每个 webview 本身的 localStorage 值?

4

1 回答 1

0

WebKit 仅使用一个数据库进行本地存储 - 查看 WebSettings 的文档

另一方面 sessionStorage 可能会做你想做的事,但是当你离开页面时你会丢失数据

于 2012-05-23T08:12:24.390 回答