tantaman / LargeLocalStorage

Problem: You need to store a large amount of key-value based data in IE, Chrome, Safari, AND Firefox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can anyone get this library to work?

chrisspen opened this issue · comments

I realize this project was abandoned years ago, but has anyone been able to get it to work?

I can't even get the storage initialization code to run. If I do something like:

var requestedBytes = 1024*1024*10; // MB

$(document).ready(function(){

    // Create a key-value store
    var storage = new LargeLocalStorage({size: requestedBytes, name: 'mydb'});

    // Await initialization of the storage area
    console.log('initializing storage')
    storage.initialized.then(function(grantedCapacity){
        // Check to see how much space the user authorized us to actually use.
        // Some browsers don't indicate how much space was granted in which case
        // grantedCapacity will be 1.
        if (grantedCapacity != -1 && grantedCapacity != requestedBytes) {
            console.log('error granting full capacity');
        }else{
            console.log('storage granted!')
        }
    });

});

and run it in a recent version of Chrome, the console shows initializing storage, but it never shows any of the log messages for when the storage is finished initializing, implying it never runs.

It looks like grantedCapacity is no longer an integer, but some sort of Object.