From 8643b8e9af1a11017fb9e6a2b02290d586e19615 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Tue, 4 Feb 2014 15:37:35 +0100 Subject: [PATCH] Drop data that exceeds QUOTA_BYTES_PER_ITEM. --- src/General/lib/$.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index 7578b27b0..1b29eb85e 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -343,6 +343,9 @@ do -> if chrome.runtime.lastError c.error chrome.runtime.lastError.message 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 timeout[area] = setTimeout setArea, $.MINUTE, area return