5

I'm using Lawnchair to store persistent data using the "dom adapter" of my web client (Firefox 13.0) and have hit the storage quota. Console.log says

Persistent storage maximum size reached

Fair enough; I'll just nuke it with this:

<script type="text/javascript" charset="utf-8">
            Lawnchair(function() {
                this.nuke();
                console.log("nuked");
            });
</script>

Before I hit my storage quota, the code above worked to wipe everything out of persistent storage. But now it doesn't work. The page displays fine, but console log shows nothing. I expect it to say "nuked" as it used to.

The following code displays all of my persistent data (after trying to nuke() it with the code above).

<script type="text/javascript" charset="utf-8">
            Lawnchair(function() {
                this.keys(function(values) {
                        values.forEach(console.log)
                    })
            });
</script>

How can I make Lawnchair.nuke() work after it's hit its storage limit?

4

3 回答 3

1

You can use localStorage.clear() - just to be on the safe side. But nevertheless, open Chrome devltools and see what is the state of your localStorage... It will show you in a table (key,val) what is going on inside the local storage.

You might also want to debug the nuke and see why it's not working in your case. It might be due to some keys changes or a bug.

于 2012-05-16T18:45:59.350 回答
1

Try this:

Lawnchair( function() {
this.keys( function(key) {
this.remove(key);})
});
于 2013-02-23T00:25:37.050 回答
1

This was a bug. I ran into the same problem. Pulling from github and running 'make build' to generate the current lawnchair in lib/ fixed the problem.

于 2013-04-09T11:24:41.993 回答