Drop data that exceeds QUOTA_BYTES_PER_ITEM.
This commit is contained in:
parent
0b00e393b6
commit
5da0344a45
@ -278,6 +278,9 @@ do ->
|
|||||||
if chrome.runtime.lastError
|
if chrome.runtime.lastError
|
||||||
c.error chrome.runtime.lastError.message
|
c.error chrome.runtime.lastError.message
|
||||||
for key, val of data when key not of items[area]
|
for key, val of data when key not of items[area]
|
||||||
|
if area is 'sync' and chrome.storage.sync.QUOTA_BYTES_PER_ITEM < JSON.stringify(val).length + key.length
|
||||||
|
c.error chrome.runtime.lastError.message, key, val
|
||||||
|
continue
|
||||||
items[area][key] = val
|
items[area][key] = val
|
||||||
timeout[area] = setTimeout setArea, $.MINUTE, area
|
timeout[area] = setTimeout setArea, $.MINUTE, area
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user