phonegap/phonegap-android — Issue #281: Detect for localStorage if Java has disabled it
Author: aogilvie
Created: 2011-10-26 09:51:39+00:00
State: open

Hi, you need to change the following line;
[line: 385 from commit: 8ce7e61] or
[line: 4572 of build v1.1.0]

if (typeof window.localStorage == "undefined") {

to

if (!window.localStorage) {

or

if ( (typeof window.localStorage == "undefined") || (window.localStorage == null) ) {

because if I set on main Activity (in Android 2.2 for example)

WebSettings settings = super.appView.getSettings();
settings.setDomStorageEnabled(false);

^ in Java, then window.localStorage will be null and I would expect phoneGap to kick in and supply me with the navigator.localStorage solution but the current code will not detect the Java change.