aboutsummaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
Diffstat (limited to 'background')
-rw-r--r--background/storage_server.js12
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);