How to delete the localStorage of your web browser (programmatically)


There are many ways to clear the localStorage of your web browser.

In a common dev toolbar just type:
localStorage.clear();
If you are using jQuery:
$.storage('clear');
If you are using Sencha:
// proxy
var store = Ext.getStore('YourStore');
store.getProxy().clear();
store.data.clear();
store.sync();

// no proxy
var store = Ext.getStore('YourStore');
store.removeAll();
store.sync();
You can also delete the localStorage via a bookmark. Just add the following snippet as new bookmark:
javascript:(function(){localStorage.clear()})();

1 comment:

  1. Clearing local storage in a web application involves using JavaScript's localStorage.clear() method. Why Router Off By invoking this function, stored data is erased, offering a clean slate for user preferences or temporary data.

    ReplyDelete