diff options
author | jahoti <jahoti@tilde.team> | 2021-07-21 00:00:00 +0000 |
---|---|---|
committer | jahoti <jahoti@tilde.team> | 2021-07-21 00:00:00 +0000 |
commit | efce4e9807889e9269534b19c8e0cbb4df527ecd (patch) | |
tree | 0a951d1b2b5c1470f7baf2be41585f5f08a09a9a /background/storage_server.js | |
parent | efd6ae83e6e48008988a2a11ac1658ec71dc82d2 (diff) | |
parent | c483ae19e110ef5c1e539883a38fbc79b3dd4e4e (diff) | |
download | browser-extension-efce4e9807889e9269534b19c8e0cbb4df527ecd.tar.gz browser-extension-efce4e9807889e9269534b19c8e0cbb4df527ecd.zip |
Merge remote-tracking branch 'origin/koszko' into jahoti
Diffstat (limited to 'background/storage_server.js')
-rw-r--r-- | background/storage_server.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/background/storage_server.js b/background/storage_server.js index 554aff2..2252eb5 100644 --- a/background/storage_server.js +++ b/background/storage_server.js @@ -9,7 +9,7 @@ * IMPORTS_START * IMPORT listen_for_connection * IMPORT get_storage - * IMPORT TYPE_PREFIX + * IMPORT list_prefixes * IMPORT CONNECTION_TYPE * IMPORTS_END */ @@ -38,11 +38,11 @@ function new_connection(port) { console.log("new remote storage connection!"); - port.postMessage({ - [TYPE_PREFIX.SCRIPT] : storage.get_all(TYPE_PREFIX.SCRIPT), - [TYPE_PREFIX.BAG] : storage.get_all(TYPE_PREFIX.BAG), - [TYPE_PREFIX.PAGE] : storage.get_all(TYPE_PREFIX.PAGE) - }); + const message = {}; + for (const prefix of list_prefixes) + message[prefix] = storage.get_all(prefix); + + port.postMessage(message); let handle_change = change => port.postMessage(change); |