Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome app webview - clear persistent data

I'm writing a Chrome Desktop app with a webview. I'd like to clear all data, including cache and cookies.

I've found this possibly related thread, but it doesn't seem to be working: https://code.google.com/p/chromium/issues/detail?id=174763

Any idea? The best solution would be to use a webview with persistent storage, but also an in-memory solution could suffice.

like image 605
ecesena Avatar asked Jan 30 '26 00:01

ecesena


1 Answers

As of Chrome 33, you can use the webview.clearData() method to clear some types of data, including cookies. However this will not clear cache.

An alternative is to use a unique partition ID each time you create your webview. This will force the new webview to use a different storage partition each time.

like image 159
Sarah Elan Avatar answered Feb 02 '26 07:02

Sarah Elan