From b3b224a8dfdbea62bbc51d745dc7eb14dde572b2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 29 Mar 2013 02:59:20 +0100 Subject: [PATCH] Make $.set use the Chrome storage API. This is about to get really ugly. --- lib/$.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/$.coffee b/lib/$.coffee index 4b3b321a1..9c12aba7a 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -210,7 +210,9 @@ $.extend $, else defaultVal set: (key, val) -> - localStorage.setItem g.NAMESPACE + key, JSON.stringify val + item = {} + item[key] = val + chrome.storage.sync.set item <% } else if (type === 'userjs') { %> do -> # http://www.opera.com/docs/userjs/specs/#scriptstorage