summaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-04 16:57:07 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-04 17:25:17 +0100
commit4970930c2f866133c38fa73800f1a963f0856692 (patch)
tree5cb1f7aaa317b02dbc266a62e07c21b05340b106 /background
parent7fdb3e8474488de2b18da7e9b63719bb05961819 (diff)
downloadbrowser-extension-4970930c2f866133c38fa73800f1a963f0856692.tar.gz
browser-extension-4970930c2f866133c38fa73800f1a963f0856692.zip
prepend all generated console messages with 'Haketilo:'
Diffstat (limited to 'background')
-rw-r--r--background/broadcast_broker.js2
-rw-r--r--background/indexeddb_files_server.js4
-rw-r--r--background/stream_filter.js4
-rw-r--r--background/webrequest.js6
4 files changed, 8 insertions, 8 deletions
diff --git a/background/broadcast_broker.js b/background/broadcast_broker.js
index d8a0e28..5e6384e 100644
--- a/background/broadcast_broker.js
+++ b/background/broadcast_broker.js
@@ -154,7 +154,7 @@ function broadcast(channel_name, value)
try {
listener_ctx.port.postMessage([channel_name, value]);
} catch (e) {
- console.error(e);
+ console.error("Haketilo:", e);
remove_broadcast_listener(listener_ctx);
}
}
diff --git a/background/indexeddb_files_server.js b/background/indexeddb_files_server.js
index c548b74..d3ea8ab 100644
--- a/background/indexeddb_files_server.js
+++ b/background/indexeddb_files_server.js
@@ -124,12 +124,12 @@ async function send_resource_files(root_resource_id, send_cb) {
} catch(e) {
if (typeof e === "object" && "haketilo_error_type" in e) {
if (e.haketilo_error_type === "db") {
- console.error(e.e);
+ console.error("Haketilo:", e.e);
delete e.e;
}
var to_send = {error: e};
} else {
- console.error(e);
+ console.error("Haketilo:", e);
var to_send = {error: {haketilo_error_type: "other"}};
}
}
diff --git a/background/stream_filter.js b/background/stream_filter.js
index 0de7f49..921523a 100644
--- a/background/stream_filter.js
+++ b/background/stream_filter.js
@@ -106,8 +106,8 @@ function create_decoder(properties, data)
{
let charset = charset_from_BOM(data) || properties.detected_charset;
if (!charset && data.indexOf(0) !== -1) {
- console.debug("Warning: zeroes in bytestream, probable cached encoding mismatch. Trying to decode it as UTF-16.",
- properties);
+ console.warn("Haketilo: zeroes in bytestream, probable cached encoding mismatch. Trying to decode it as UTF-16.",
+ properties);
return new TextDecoder("utf-16be");
}
diff --git a/background/webrequest.js b/background/webrequest.js
index bceba26..f0c5b1b 100644
--- a/background/webrequest.js
+++ b/background/webrequest.js
@@ -117,7 +117,7 @@ function on_before_request(details)
return;
#IF DEBUG
- console.debug(`Settings queried using XHR for '${details.url}'.`);
+ console.debug(`Haketilo: Settings queried using XHR for '${details.url}'.`);
#ENDIF
/*
@@ -129,7 +129,7 @@ function on_before_request(details)
const queried_url = decodeURIComponent(match[1]);
if (details.initiator && !queried_url.startsWith(details.initiator)) {
- console.warn(`Blocked suspicious query of '${url}' by '${details.initiator}'. This might be the result of page fingerprinting the browser.`);
+ console.warn(`Haketilo: Blocked suspicious query of '${url}' by '${details.initiator}'. This might be the result of page fingerprinting the browser.`);
return {cancel: true};
}
@@ -140,7 +140,7 @@ function on_before_request(details)
}
}
- console.warn(`Bad request! Expected ${browser.runtime.getURL("dummy")}?url=<valid_urlencoded_url>. Got ${details.url}. This might be the result of page fingerprinting the browser.`);
+ console.warn(`Haketilo: Bad request! Expected ${browser.runtime.getURL("dummy")}?url=<valid_urlencoded_url>. Got ${details.url}. This might be the result of page fingerprinting the browser.`);
return {cancel: true};
}