Domanda

I am using chrome.storage.sync for some of my chrome extensions, great tool!

But I have an issue now, after updating the storage like 10 times. It blocks and does not update anymore... No error or anything so I do not know where the problem is.

FYI: I still have space in the storage.

The code:

Storage.get_all = function(callback) {
    STORAGE_SYNC.get('key', function(items) {
        callback(items.gifs_v2);
    });
};

Storage.post = function(id, item, callback) {
    var THIS = this;

    THIS.get_all(function(items) {
        if(items) {
            items[id] = item;
            STORAGE_SYNC.set({'key': items}, callback);
        } else {
            THIS.post_all({}, function() {
                THIS.post(id, item, callback);
            });
        }
    })
};
È stato utile?

Soluzione

There are several quotas published in the official documentation. Look it up. You probably run out of one of them. Remember that sync also goes into google's sync servers so abusing them will block you for a while. If you dont need to sync among devices use the regular local storage instead of sync.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top