window.localStorage
returns all the values in local storage.
You can print them all to console by `console.log(window.localStorage);
You can use Console APIs in WebView to get the stuff from console
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebChromeClient(new WebChromeClient() {
public void onConsoleMessage(String message, int lineNumber, String sourceID) {
Log.d("MyApplication", message + " -- From line "
+ lineNumber + " of "
+ sourceID);
}
});
You can try with following HTML if you want
`
<html>
<body>
value read from localstorage:<input type="text" id="test"><br>
value read from localstorage:<input type="text" id="test2"><p>
Open Console to read all values
<script>
window.localStorage.setItem("name", "Peter");
window.localStorage.setItem("name2", "Tom");
window.localStorage.setItem("name3", "Steve");
window.localStorage.setItem("name4", "Ian");
test.value=window.localStorage["name"];
test2.value=window.localStorage["name3"];
console.log(window.localStorage);
</script>
</body>
</html>
But this is for things that are stored in your page. You cannot directly read information from other pages in iFrame from different domain. However, if you own all those pages, you can do use info from Cross-Domain LocalStorage.