aboutsummaryrefslogtreecommitdiff
path: root/content
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 /content
parent7fdb3e8474488de2b18da7e9b63719bb05961819 (diff)
downloadbrowser-extension-4970930c2f866133c38fa73800f1a963f0856692.tar.gz
browser-extension-4970930c2f866133c38fa73800f1a963f0856692.zip
prepend all generated console messages with 'Haketilo:'
Diffstat (limited to 'content')
-rw-r--r--content/content.js6
-rw-r--r--content/policy_enforcing.js6
2 files changed, 6 insertions, 6 deletions
diff --git a/content/content.js b/content/content.js
index 7cbb523..ef2ee39 100644
--- a/content/content.js
+++ b/content/content.js
@@ -59,7 +59,7 @@ function synchronously_get_policy(url)
xhttp.open("GET", request_url, false);
xhttp.send();
} catch(e) {
- console.error("Failure to synchronously fetch policy for url.", e);
+ console.error("Haketilo: Failure to synchronously fetch policy for url.", e);
return fallback_policy();
}
@@ -67,7 +67,7 @@ function synchronously_get_policy(url)
const policy = /^[^?]*\?settings=(.*)$/.exec(xhttp.responseURL)[1];
return JSON.parse(decodeURIComponent(policy));
} catch(e) {
- console.error("Failure to process synchronously fetched policy for url.", e);
+ console.error("Haketilo: Failure to process synchronously fetched policy for url.", e);
return fallback_policy()
}
}
@@ -108,7 +108,7 @@ async function main() {
globalThis.haketilo_default_allow,
globalThis.haketilo_secret);
} catch(e) {
- console.error(e);
+ console.error("Haketilo:", e);
var policy = fallback_policy();
}
#ELSE
diff --git a/content/policy_enforcing.js b/content/policy_enforcing.js
index 63c5119..0b74de9 100644
--- a/content/policy_enforcing.js
+++ b/content/policy_enforcing.js
@@ -224,7 +224,7 @@ function sanitize_element_onevent(element) {
* blocked and unable to redefine properties, anyway.
*/
if (Object.getOwnPropertyDescriptor(element.wrappedJSObject, attr)) {
- console.error("Redefined property on a DOM object! The page might have bypassed our script blocking measures!");
+ console.error("Haketilo: Redefined property on a DOM object! The page might have bypassed our script blocking measures!");
continue;
}
element.wrappedJSObject[attr] = null;
@@ -348,7 +348,7 @@ async function _disable_service_workers() {
if (registrations.length === 0)
return;
- console.warn("Service Workers detected on this page! Unregistering and reloading.");
+ console.warn("Haketilo: Service Workers detected on this page! Unregistering and reloading.");
try {
await Promise.all(registrations.map(r => r.unregister()));
@@ -369,7 +369,7 @@ async function disable_service_workers() {
try {
await _disable_service_workers()
} catch (e) {
- console.debug("Exception thrown during an attempt to detect and disable service workers.", e);
+ console.warn("Haketilo: Exception thrown during an attempt to detect and disable service workers.", e);
}
}