largeSync - chrome-storage-largeSync
largeSync wraps chrome.storage.sync
. it makes it easy to store objects larger than is allowed by default. Useful for Google Chrome extensions and apps.
chrome.storage.sync enforces two byte limits.
QUOTA_BYTES_PER_ITEM
8,192 - (measured by the JSON stringification of the item plus its key length)QUOTA_BYTES
102,400 - (total across all items)
largeSync "compresses" and splits objects up between multiple keys in chrome.storage.sync, this makes QUOTA_BYTES
the only relevant space limitation.
Dependencies
lz-string
- "compress" strings
Install
The file to use is dist/chrome-storage-largeSync.min.js
or dist/chrome-storage-largeSync.js
bower : bower install chrome-storage-largeSync --save
npm: npm install chrome-storage-largesync --save
for local build clone and run these commands
npm install
,bower install
and grunt
Usage
largeSync exposes the same api schema as chrome.storage
,
The API is exposed in two different places largeSync
and chrome.storage.largeSync
Methods
//get: Gets one or more items from storage.largeSync
Example
var testObj = 'a' : 'b' : ;for var i = 0; i < 5000; i++ testObja; testObjb;chromestoragelargeSync;
chrome.storage.sync will now contain something similar to this.
to retrieve and reconstruct the object
chromestoragelargeSync;
Tests
load test
folder as an unpacked extension. it will override the new-tab page.