From 3fbb689e0a49d70950a447d0a1ce2e30c771a36f Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Tue, 31 Dec 2019 19:01:17 +0000 Subject: [PATCH] Moving utils --- popup.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/popup.js b/popup.js index 1a242a79..87ba0d30 100644 --- a/popup.js +++ b/popup.js @@ -1,37 +1,3 @@ -SB = {}; - -function configProxy() { - chrome.storage.onChanged.addListener((changes, namespace) => { - for (key in changes) { - localconfig[key] = changes[key].newValue; - } - }); - var handler = { - set: function(obj, prop, value) { - chrome.storage.sync.set({ - [prop]: value - }) - }, - get: function(obj, prop) { - return localconfig[prop] - } - }; - return new Proxy({}, handler); -} - -fetchConfig = _ => new Promise(function(resolve, reject) { - chrome.storage.sync.get(null, function(items) { - localconfig = items; // Data is ready - resolve(); - }); -}); - -async function config() { - localconfig = {}; - await fetchConfig(); - SB.config = configProxy(); -} - //make this a function to allow this to run on the content page async function runThePopup() { localizeHtmlPage();