I am trying to share data in activity between webView and CordovaWebView. CordovaWebView of course using webView and that is why I do not understand why data stored in localStorage in my phoneGap app is not visible in simple webView which load html page from the same location as main application does. I've already investigated that data stored by the CordovaWebView is stored in file /app_webview/Local Storage/file__0.localstorage and data stored by created instance of webView class is stored in file /app_webview/Local Storage/__0.localstorage that is why I cannot access data. I am loading the script storing data in localStorage to webView like this:
webView.loadUrl("file:///android_asset/www/script.html");
Main page in CordovaWebView is loaded in the same way:
void loadUrlNow(String url) {
if (LOG.isLoggable(LOG.DEBUG) && !url.startsWith("javascript:")) {
LOG.d(TAG, ">>> loadUrlNow()");
}
if (url.startsWith("file://") || url.startsWith("javascript:") || Config.isUrlWhiteListed(url)) {
super.loadUrl(url);
}
}
where url is
file:///android_asset/www/index.html
So why in CordovaWebView localStorage is saved in file
/app_webview/Local Storage/file__0.localstorage
And in webview in file
/app_webview/Local Storage/__0.localstorage