Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "enable DOM storage API" mean?

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

The Android documentation, however, suggests something slightly different:

Set whether the DOM storage API is enabled.

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

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

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

  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?

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

like image 395
uTubeFan Avatar asked May 02 '11 15:05

uTubeFan


People also ask

What is DOM Storage API?

What is DOM Storage? DOM Storage is a way to store meaningful amounts of client-side data in a persistent and secure manner. It is a W3C draft which covers exactly how saving information on the client-side should be done. It was initially part of the HTML 5 specification, but was then taken out to be independent.

How do I enable DOM storage on my Android?

Type about:config in the address bar to view advanced settings (you may need to click an "Accept the Risk and Continue" button in order to view settings). Search for " dom. storage. enabled ", and double-click on the entry (or use the adjacent toggle button) to toggle its enabled/disabled state.


1 Answers

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.

like image 148
Justin Pearce Avatar answered Oct 04 '22 04:10

Justin Pearce