什么是“启用 DOM 存储 API"?意思是? [英] What does "enable DOM storage API" mean?

查看:39
本文介绍了什么是“启用 DOM 存储 API"?意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个 Android WebView 函数 WebSettings.setDomStorageEnabled(true) 仅从名称我就可以推断它只是启用 DOM 存储".

I came across this Android WebView function WebSettings.setDomStorageEnabled(true) and from the name alone I can infer that it simply "enables DOM storage".

然而,Android 文档提出了一些稍微不同的建议:

The Android documentation, however, suggests something slightly different:

设置DOM存储API是否为已启用.

Set whether the DOM storage API is enabled.

IOW,它启用 API 而不是存储本身.

IOW, it enables the API rather than the storage itself.

我的问题是...直到我遇到这个函数我才知道有这样一个 API 的存在.

My problem is... I didn't know about the existence of such an API until I encountered this function.

我的 Google 搜索表明此 API 与 HTML5.

My Google search suggests that this API is closely associated with HTML5.

  1. 这是否意味着这个函数是与网站/页面无关不使用 HTML5?IOW,有吗影响现有的非 HTML5 页面加载&完全渲染?
  2. 在哪里可以了解更多关于 DOM 的信息存储 API?
  3. 特别是,是否有任何问题或我需要注意的警告打电话时WebSettings.setDomStorageEnabled(true)在 Android 应用中?
  4. 为什么默认禁用?
  1. Does that mean that this function is irrelevant to web sites/pages that do not use HTML5? IOW, does it affect existing non-HTML5 page loading & rendering at all?
  2. Where can I learn more about the DOM storage API?
  3. In particular, are there any gotchas or caveats that I need to watch for when calling WebSettings.setDomStorageEnabled(true) in an Android app?
  4. Why is it disabled by default?

更新:我现在至少可以回答问题 2:事实证明,DOM 存储"的通用名称是Web 存储",并且有一篇关于此的完整维基百科文章:http://en.wikipedia.org/wiki/Web_Storage

Update: I now can at least answer question #2: It turns out that the common name for "DOM Storage" is "Web Storage" and there is an entire Wikipedia article about this: http://en.wikipedia.org/wiki/Web_Storage

推荐答案

我相信此功能与不使用 HTML 5 规范的网站无关,因为它是该规范的一部分.我想在启用这个 API 时要注意的主要事情是它会允许任何利用 DOM 存储的网站使用设备上的所述存储选项.我想它在默认情况下是禁用的,以节省空间和安全.

I believe this functionality is irrelevant for websites that do not use the HTML 5 specifications, since it is part of that spec. I would imagine the main thing to look out for when enabling this API is that it would then allow ANY website that takes advantage of DOM storage to use said storage options on the device. I would imagine it is disabled by default for space savings and security.

这篇关于什么是“启用 DOM 存储 API"?意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆