summaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
authorWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 17:41:08 +0200
committerWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 17:41:08 +0200
commitf6a7f24e61a78f197250875ac9833f497a455d20 (patch)
tree9549ac201aeb8f8ed1cfef6270bae9c459476577 /background
parent55fb3e4bd833f042a82657cc75e7e4c657402f9e (diff)
downloadbrowser-extension-f6a7f24e61a78f197250875ac9833f497a455d20.tar.gz
browser-extension-f6a7f24e61a78f197250875ac9833f497a455d20.zip
rename "bundles" to "bags"
Diffstat (limited to 'background')
-rw-r--r--background/main.js4
-rw-r--r--background/page_actions_server.js24
-rw-r--r--background/reverse_use_info.js6
-rw-r--r--background/storage.js6
-rw-r--r--background/storage_server.js2
5 files changed, 21 insertions, 21 deletions
diff --git a/background/main.js b/background/main.js
index f4b01f8..6b636c4 100644
--- a/background/main.js
+++ b/background/main.js
@@ -116,10 +116,10 @@
text: "console.log(\"hello, every1!\");\n"
};
await storage.set(TYPE_PREFIX.SCRIPT, "hello", hello_script);
- await storage.set(TYPE_PREFIX.BUNDLE, "hello",
+ await storage.set(TYPE_PREFIX.BAG, "hello",
[[TYPE_PREFIX.SCRIPT, "hello"]]);
await storage.set(TYPE_PREFIX.PAGE, "https://my.fsf.org/", {
- components: [[TYPE_PREFIX.BUNDLE, "hello"]],
+ components: [[TYPE_PREFIX.BAG, "hello"]],
allow: true
});
diff --git a/background/page_actions_server.js b/background/page_actions_server.js
index fbb672e..2a0b858 100644
--- a/background/page_actions_server.js
+++ b/background/page_actions_server.js
@@ -29,31 +29,31 @@
return;
let components = settings.components;
- let processed_bundles = new Set();
+ let processed_bags = new Set();
- send_scripts_rec(components, port, processed_bundles);
+ send_scripts_rec(components, port, processed_bags);
}
// TODO: parallelize script fetching
- async function send_scripts_rec(components, port, processed_bundles)
+ async function send_scripts_rec(components, port, processed_bags)
{
for (let [prefix, name] of components) {
- if (prefix === TYPE_PREFIX.BUNDLE) {
- if (processed_bundles.has(name)) {
- console.log(`preventing recursive inclusion of bundle ${name}`);
+ if (prefix === TYPE_PREFIX.BAG) {
+ if (processed_bags.has(name)) {
+ console.log(`preventing recursive inclusion of bag ${name}`);
continue;
}
- var bundle = storage.get(TYPE_PREFIX.BUNDLE, name);
+ var bag = storage.get(TYPE_PREFIX.BAG, name);
- if (bundle === undefined) {
- console.log(`no bundle in storage for key ${name}`);
+ if (bag === undefined) {
+ console.log(`no bag in storage for key ${name}`);
continue;
}
- processed_bundles.add(name);
- await send_scripts_rec(bundle, port, processed_bundles);
- processed_bundles.delete(name);
+ processed_bags.add(name);
+ await send_scripts_rec(bag, port, processed_bags);
+ processed_bags.delete(name);
} else {
let script_text = await get_script_text(name);
if (script_text === undefined)
diff --git a/background/reverse_use_info.js b/background/reverse_use_info.js
index 3399285..688cd64 100644
--- a/background/reverse_use_info.js
+++ b/background/reverse_use_info.js
@@ -1,5 +1,5 @@
/**
-* Myext scripts and bundles usage index
+* Myext scripts and bags usage index
*
* Copyright (C) 2021 Wojtek Kosior
*
@@ -11,7 +11,7 @@
"use strict";
/*
- * We want to count referenes to scripts and bundles in order to know,
+ * We want to count referenes to scripts and bags in order to know,
* for example, whether one can be safely deleted.
*/
@@ -83,7 +83,7 @@
{
storage = await get_storage();
- prefixes = [TYPE_PREFIX.PAGE, TYPE_PREFIX.BUNDLE];
+ prefixes = [TYPE_PREFIX.PAGE, TYPE_PREFIX.BAG];
for (let prefix of prefixes)
build_reverse_uses_info(prefix);
diff --git a/background/storage.js b/background/storage.js
index ea390ef..5578109 100644
--- a/background/storage.js
+++ b/background/storage.js
@@ -104,7 +104,7 @@
}
var pages;
- var bundles;
+ var bags;
var scripts;
var list_by_prefix = {};
@@ -310,8 +310,8 @@
*/
/*
- * For bundles, item name is chosen by user, data is an array of 2-element
- * arrays with type prefix and script/bundle names.
+ * For bags, item name is chosen by user, data is an array of 2-element
+ * arrays with type prefix and script/bag names.
*/
/*
diff --git a/background/storage_server.js b/background/storage_server.js
index 05f616b..a4b292c 100644
--- a/background/storage_server.js
+++ b/background/storage_server.js
@@ -41,7 +41,7 @@
port.postMessage({
[TYPE_PREFIX.SCRIPT] : storage.get_all(TYPE_PREFIX.SCRIPT),
- [TYPE_PREFIX.BUNDLE] : storage.get_all(TYPE_PREFIX.BUNDLE),
+ [TYPE_PREFIX.BAG] : storage.get_all(TYPE_PREFIX.BAG),
[TYPE_PREFIX.PAGE] : storage.get_all(TYPE_PREFIX.PAGE)
});