It does not seem to exist. I tried to access browser data using content providers, but you can only access bookmarks and history.
I also did some tests using WebView instead of browser. I tried two approaches:
- Access to the local warehouse database
You can access a local repository database, such as a regular SQLite database. Data is stored in one table with two columns - key and value. According to javascript documentation, writing to local storage is a synchronous operation. Excellent! The problem is that saving data from the browser (webview) to the file system is asynchronous. Therefore, if you write something in local storage, it is stored in memory, therefore it is accessible through the javascript API, but it is still not stored in the SQLite database.
- Access local storage via javascript bridge
This is my personal recommendation! You created the javascript JavaScript interface and added it to the webview. This way you provide an API for javascript to access your code. Be extremely careful! This can be a serious security issue! Double check your code! After that, you can call your javascript methods as follows webview.loadUrl("javascript://...")
source share