1

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);
            });
        }
    })
};
4

1 回答 1

2

官方文档中发布了几个配额。查一下。你可能用完了其中之一。请记住,同步也会进入谷歌的同步服务器,因此滥用它们会阻止您一段时间。如果您不需要在设备之间同步,请使用常规本地存储而不是同步。

于 2013-12-18T01:53:30.250 回答