summaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
Diffstat (limited to 'background')
-rw-r--r--background/indexeddb_files_server.js4
-rw-r--r--background/patterns_query_manager.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/background/indexeddb_files_server.js b/background/indexeddb_files_server.js
index 0c3f7d8..24fa700 100644
--- a/background/indexeddb_files_server.js
+++ b/background/indexeddb_files_server.js
@@ -62,7 +62,7 @@ async function get_resource_files(getting, id) {
.map(s => haketilodb.idb_get(getting.tx, "files", s.sha256));
const deps_proms = (definition.dependencies || [])
- .map(dep_id => get_resource_files(getting, dep_id));
+ .map(res_ref => get_resource_files(getting, res_ref.identifier));
const files = (await Promise.all(file_proms)).map(f => f.contents);
getting.files_by_res_id.set(id, files);
@@ -93,7 +93,7 @@ function get_files_list(defs_by_res_id, files_by_res_id, root_id) {
processed.add(id);
const ds = (defs_by_res_id.get(id).dependencies || []).reverse();
- ds.forEach(dep_id => to_process.push(["start", dep_id]));
+ ds.forEach(res_ref => to_process.push(["start", res_ref.identifier]));
}
return files;
diff --git a/background/patterns_query_manager.js b/background/patterns_query_manager.js
index 9de9d35..3e2953f 100644
--- a/background/patterns_query_manager.js
+++ b/background/patterns_query_manager.js
@@ -99,7 +99,7 @@ if (this.haketilo_content_script_main)
function register(kind, object) {
if (kind === "mappings") {
- for (const [pattern, resource] of Object.entries(object.payloads))
+ for (const [pattern, resource] of Object.entries(object.payloads || {}))
pqt.register(tree, pattern, object.identifier, resource);
} else /* if (kind === "blocking") */ {
/*
@@ -120,7 +120,7 @@ function changed(kind, change) {
const old_version = currently_registered.get(change.key);
if (old_version !== undefined) {
if (kind === "mappings") {
- for (const pattern in old_version.payloads)
+ for (const pattern in old_version.payloads || {})
pqt.deregister(tree, pattern, change.key);
} else /* if (kind === "blocking") */ {
pqt.deregister(tree, change.key, "~allow");