diff options
author | Ajay Ramachandran <[email protected]> | 2019-07-22 16:42:57 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-07-22 16:42:57 -0400 |
commit | baefc5995461f38beaed5759928ff6bbf27f923d (patch) | |
tree | b4a58611f5890c3dbd87cc124197a79625dc4e4f /background.js | |
parent | 14121af9005d5664503ac75861379cddf4afb562 (diff) | |
download | SponsorBlock-baefc5995461f38beaed5759928ff6bbf27f923d.tar.gz SponsorBlock-baefc5995461f38beaed5759928ff6bbf27f923d.zip |
Switched it from using local storage to synced storage.
Diffstat (limited to 'background.js')
-rw-r--r-- | background.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/background.js b/background.js index 026b83f8..1c1c3ad6 100644 --- a/background.js +++ b/background.js @@ -53,7 +53,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) { function getSponsorTimes(videoID, callback) { let sponsorTimes = []; let sponsorTimeKey = "sponsorTimes" + videoID; - chrome.storage.local.get([sponsorTimeKey], function(result) { + chrome.storage.sync.get([sponsorTimeKey], function(result) { let sponsorTimesStorage = result[sponsorTimeKey]; if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) { sponsorTimes = sponsorTimesStorage; @@ -79,7 +79,7 @@ function addSponsorTime(time) { //save this info let sponsorTimeKey = "sponsorTimes" + previousVideoID; - chrome.storage.local.set({[sponsorTimeKey]: sponsorTimes}); + chrome.storage.sync.set({[sponsorTimeKey]: sponsorTimes}); }); } @@ -109,7 +109,7 @@ function submitVote(type, UUID, callback) { function submitTimes(videoID, callback) { //get the video times from storage let sponsorTimeKey = 'sponsorTimes' + videoID; - chrome.storage.local.get([sponsorTimeKey], function(result) { + chrome.storage.sync.get([sponsorTimeKey], function(result) { let sponsorTimes = result[sponsorTimeKey]; if (sponsorTimes != undefined && sponsorTimes.length > 0) { @@ -140,7 +140,7 @@ function videoIDChange(currentVideoID) { if (previousVideoID != null) { //get the sponsor times from storage let sponsorTimeKey = 'sponsorTimes' + previousVideoID; - chrome.storage.local.get([sponsorTimeKey], function(result) { + chrome.storage.sync.get([sponsorTimeKey], function(result) { let sponsorTimes = result[sponsorTimeKey]; if (sponsorTimes != undefined && sponsorTimes.length > 0) { @@ -168,7 +168,7 @@ function getUserID(callback) { } //if it is not cached yet, grab it from storage - chrome.storage.local.get(["userID"], function(result) { + chrome.storage.sync.get(["userID"], function(result) { let userIDStorage = result.userID; if (userIDStorage != undefined) { userID = userIDStorage; @@ -178,7 +178,7 @@ function getUserID(callback) { userID = generateUUID(); //save this UUID - chrome.storage.local.set({"userID": userID}); + chrome.storage.sync.set({"userID": userID}); callback(userID); } |