From 4970930c2f866133c38fa73800f1a963f0856692 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 4 Mar 2022 16:57:07 +0100 Subject: prepend all generated console messages with 'Haketilo:' --- background/broadcast_broker.js | 2 +- background/indexeddb_files_server.js | 4 ++-- background/stream_filter.js | 4 ++-- background/webrequest.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'background') 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=. Got ${details.url}. This might be the result of page fingerprinting the browser.`); + console.warn(`Haketilo: Bad request! Expected ${browser.runtime.getURL("dummy")}?url=. Got ${details.url}. This might be the result of page fingerprinting the browser.`); return {cancel: true}; } -- cgit v1.2.3