199

In Google Chrome there is an easy way to see what's in local storage as well as modify or delete it after inspecting it.

Is there a way to do the same in Firefox?

2
  • Possible,but going to that link I installed that plugin and it does nothing for me :( Commented May 21, 2011 at 22:22
  • 5
    To the people who closed this question: this is a good question despite the rules (not always rules are good), voted by hundreds of users (both the question and the accepted answer). No reason to close it. You should reopen it. Commented Jun 7, 2017 at 15:25

8 Answers 8

279

You can delete localStorage items one by one using Firebug (a useful web development extension) or Firefox's developer console.

Firebug Method

  1. Open Firebug (click on the tiny bug icon in the lower right)
  2. Go to the DOM tab
  3. Scroll down to and expand localStorage
  4. Right-click the item you wish to delete and press Delete Property

Developer Console Method

You can enter these commands into the console:

localStorage; // click arrow to view object's properties
localStorage.removeItem("foo"); 
localStorage.clear(); // remove all of localStorage's properties

Storage Inspector Method

Firefox now has a built in storage inspector, which you may need to manually enable. See rahilwazir's answer below.

Sign up to request clarification or add additional context in comments.

7 Comments

Is there any way to delete all the items in local storage, without the need to click (twice) every line?
you can type localStorage = []; using your java console
this is broken beyond hope. download a movie in mega.co.nz and click DOM in firebug... see firefox going down in flames.
Note that in recent versions Firefox has a built-in JavaScript console ("Web Console"), so one doesn't have to install Firebug to do this.
@Thariama s/java console/javaScript console
|
54

From Firefox 34 onwards you now have an option for Storage Inspector, which you can enable it from developer tools settings

Once there, you can enable the Storage options under Default Firefox Developer tools

Updated 27-3-16

Firefox 48.0a1 now supports Cookies editing.

Updated 3-4-16

Firefox 48.0a1 now supports localStorage and sessionStorage editing.

Updated 02-08-16

Firefox 48 (stable release) and onward supports editing of all storage types, except IndexedDB

4 Comments

As of Firefox 38, unfortunately the Storage Inspector is read only.
@tagawa The Storage Inspector is read only by default, but Firefox has said that it’s working on developing the tool so that developers will be able to edit their storage contents in the future. See elegantthemes.com/blog/resources/…
A note to users of the German localized version of Firefox. In the Default Firefox Developer tools you find the item "Speicher" twice. The second one is the Storage Manager.
As of Firefox 82, editing of local storage is possible. However, the values displayed in the storage inspector are truncated to a certain size and if they are larger, it is not possible to read or copy their full value from there.
43

To inspect your localStorage items you may type console.log(localStorage); in your javascript console (firebug for example or in new FF versions the shipped js console).

You can use this line of Code to get rid of the browsers localStorage contents. Just execute it in your javascript console:

localStorage.clear();

3 Comments

Note that in recent versions Firefox has a built-in JavaScript console ("Web Console"), so one doesn't have to install Firebug to do this.
Firefox now also has inspect(Object) which works on localStorage, and gives a nice editable tree-view of the data stored in it.
That work, but only for the domain in the tab. What if you want to display the local storage without filtering?
10

As 'localStorage' is just another object, you can: create, view, and edit it in the 'Console'. Simply enter 'localStorage' as a command and press enter, it'll display a string containing the key-value pairs of localStorage (Tip: Click on that string for formatted output, i.e. to display each key-value pair in each line).

Comments

9

There is now a great plugin for Firebug that clones this nice feature in chrome. Check out:

https://addons.mozilla.org/en-US/firefox/addon/firestorage-plus/

It's developed by Nick Belhomme and updated regularly

1 Comment

This extension is no longer available.
5

I could not use localStorage directly in the Firefox (v27) console. I got the error:

[Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: debugger eval code :: :: line 1" data: no]

What worked was:

window.content.localStorage

Comments

0

Try this, it works for me:

var storage = null;
setLocalStorage();

function setLocalStorage() {
    storage = (localStorage ? localStorage : (window.content.localStorage ? window.content.localStorage : null));

    try {
        storage.setItem('test_key', 'test_value');//verify if posible saving in the current storage
    }
    catch (e) {
        if (e.name == "NS_ERROR_FILE_CORRUPTED") {
            storage = sessionStorage ? sessionStorage : null;//set the new storage if fails
        }
    }
}

4 Comments

Code is ok. Code + "try this" with no actual explanation makes no improvement. Now, if you add that missing explanation so that future users actually learn something, THEN you'd have a good answer.
Here is the code with comments in English: var storage = null; setLocalStorage(); function setLocalStorage() { storage = (localStorage ? localStorage : (window.content.localStorage ? window.content.localStorage : null)); try { storage.setItem('test_key', 'test_value');//evaluate if posible saving in the current storage } catch (e) { if (e.name == "NS_ERROR_FILE_CORRUPTED") { storage = sessionStorage ? sessionStorage : null;//set the new storage if fails } } }
Some browsers, like Firefox, show "NS_ERROR_FILE_CORRUPTED" error, then another option must to be implemented because clearing cache is not the solution neither "window.content.localStorage" as another resource
Great! Just edit the answer with that information, so it all flows together, and it will be a good answer.
0

The Firefox addon StoragErazor supports both manual and automatic clearing of local storage. It will clear local storage even when clearing "Cookies and Site Data" in FF Settings doesn't.

The developer console method above works only one tab at a time, AFAICT.

1 Comment

Annoying that firefox lets you clear cookies on exit, and only deletes local storage if you delete history. I WANT history, I DON'T WANT persistence.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.