10

I'm trying to clear my local storage in Firefox 13.0 so I can continue using Lawnchair.

In Firebug [Dom] tab, I have been manually deleting properties from 'localstorage' key, but it takes about 10 seconds per delete (only 454 * 10 seconds to go!). (I hoped I could release enough space to let Lawnchair.nuke() do its job, but haven't been able to so far.)

I tried visiting about:config to turn off and back on localstorage but that didn't delete what was in there.

How can I mass-delete local storage for one website in Firefox?

Community
  • 1
  • 1
Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82

2 Answers2

16

Open the built-in console, CtrlShiftK (it's faster than Firebug), and paste the following code:

while (localStorage.length) localStorage.removeItem(localStorage.key(0));

This snippet will delete all localStorage key-value pairs on the given website.

Rob W
  • 341,306
  • 83
  • 791
  • 678
  • 5
    @ThunderRabbit [**`localstorage.clear()`**](http://dev.w3.org/html5/webstorage/#dom-storage-clear) should also do the same thing. – Rob W May 02 '12 at 13:44
  • now, when I do that in Firefox 26 there is error in console: "Error: The operation is insecure." – Piotrek Dec 31 '13 at 11:41
11
localStorage.clear(); // Capital S is required.

This will clear all key-value pairs.

TRiG
  • 10,148
  • 7
  • 57
  • 107
hamhamed
  • 159
  • 2
  • 7