Revision 4970930c
Added by koszko over 1 year ago
background/broadcast_broker.js | ||
---|---|---|
154 | 154 |
try { |
155 | 155 |
listener_ctx.port.postMessage([channel_name, value]); |
156 | 156 |
} catch (e) { |
157 |
console.error(e); |
|
157 |
console.error("Haketilo:", e);
|
|
158 | 158 |
remove_broadcast_listener(listener_ctx); |
159 | 159 |
} |
160 | 160 |
} |
background/indexeddb_files_server.js | ||
---|---|---|
124 | 124 |
} catch(e) { |
125 | 125 |
if (typeof e === "object" && "haketilo_error_type" in e) { |
126 | 126 |
if (e.haketilo_error_type === "db") { |
127 |
console.error(e.e); |
|
127 |
console.error("Haketilo:", e.e);
|
|
128 | 128 |
delete e.e; |
129 | 129 |
} |
130 | 130 |
var to_send = {error: e}; |
131 | 131 |
} else { |
132 |
console.error(e); |
|
132 |
console.error("Haketilo:", e);
|
|
133 | 133 |
var to_send = {error: {haketilo_error_type: "other"}}; |
134 | 134 |
} |
135 | 135 |
} |
background/stream_filter.js | ||
---|---|---|
106 | 106 |
{ |
107 | 107 |
let charset = charset_from_BOM(data) || properties.detected_charset; |
108 | 108 |
if (!charset && data.indexOf(0) !== -1) { |
109 |
console.debug("Warning: zeroes in bytestream, probable cached encoding mismatch. Trying to decode it as UTF-16.",
|
|
110 |
properties);
|
|
109 |
console.warn("Haketilo: zeroes in bytestream, probable cached encoding mismatch. Trying to decode it as UTF-16.",
|
|
110 |
properties); |
|
111 | 111 |
return new TextDecoder("utf-16be"); |
112 | 112 |
} |
113 | 113 |
|
background/webrequest.js | ||
---|---|---|
117 | 117 |
return; |
118 | 118 |
|
119 | 119 |
#IF DEBUG |
120 |
console.debug(`Settings queried using XHR for '${details.url}'.`); |
|
120 |
console.debug(`Haketilo: Settings queried using XHR for '${details.url}'.`);
|
|
121 | 121 |
#ENDIF |
122 | 122 |
|
123 | 123 |
/* |
... | ... | |
129 | 129 |
const queried_url = decodeURIComponent(match[1]); |
130 | 130 |
|
131 | 131 |
if (details.initiator && !queried_url.startsWith(details.initiator)) { |
132 |
console.warn(`Blocked suspicious query of '${url}' by '${details.initiator}'. This might be the result of page fingerprinting the browser.`); |
|
132 |
console.warn(`Haketilo: Blocked suspicious query of '${url}' by '${details.initiator}'. This might be the result of page fingerprinting the browser.`);
|
|
133 | 133 |
return {cancel: true}; |
134 | 134 |
} |
135 | 135 |
|
... | ... | |
140 | 140 |
} |
141 | 141 |
} |
142 | 142 |
|
143 |
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.`); |
|
143 |
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.`);
|
|
144 | 144 |
|
145 | 145 |
return {cancel: true}; |
146 | 146 |
} |
common/indexeddb.js | ||
---|---|---|
215 | 215 |
{ |
216 | 216 |
for (const uses of Object.values(context.file_uses)) { |
217 | 217 |
if (uses.uses < 0) |
218 |
console.error("internal error: uses < 0 for file " + uses.sha256); |
|
218 |
console.error("Haketilo: internal error: uses < 0 for file " + uses.sha256);
|
|
219 | 219 |
|
220 | 220 |
const is_new = uses.new; |
221 | 221 |
const initial_uses = uses.initial; |
common/patterns.js | ||
---|---|---|
174 | 174 |
const deco = deconstruct_url(url); |
175 | 175 |
|
176 | 176 |
if (deco === undefined) { |
177 |
console.error("bad url format", url); |
|
177 |
console.error("Haketilo: bad url format", url);
|
|
178 | 178 |
return false; |
179 | 179 |
} |
180 | 180 |
|
common/policy.js | ||
---|---|---|
64 | 64 |
try { |
65 | 65 |
var payloads = pqt.search(patterns_tree, url).next().value; |
66 | 66 |
} catch (e) { |
67 |
console.error(e); |
|
67 |
console.error("Haketilo:", e);
|
|
68 | 68 |
policy.allow = false; |
69 | 69 |
policy.error = {haketilo_error_type: "deciding_policy"}; |
70 | 70 |
} |
content/content.js | ||
---|---|---|
59 | 59 |
xhttp.open("GET", request_url, false); |
60 | 60 |
xhttp.send(); |
61 | 61 |
} catch(e) { |
62 |
console.error("Failure to synchronously fetch policy for url.", e); |
|
62 |
console.error("Haketilo: Failure to synchronously fetch policy for url.", e);
|
|
63 | 63 |
return fallback_policy(); |
64 | 64 |
} |
65 | 65 |
|
... | ... | |
67 | 67 |
const policy = /^[^?]*\?settings=(.*)$/.exec(xhttp.responseURL)[1]; |
68 | 68 |
return JSON.parse(decodeURIComponent(policy)); |
69 | 69 |
} catch(e) { |
70 |
console.error("Failure to process synchronously fetched policy for url.", e); |
|
70 |
console.error("Haketilo: Failure to process synchronously fetched policy for url.", e);
|
|
71 | 71 |
return fallback_policy() |
72 | 72 |
} |
73 | 73 |
} |
... | ... | |
108 | 108 |
globalThis.haketilo_default_allow, |
109 | 109 |
globalThis.haketilo_secret); |
110 | 110 |
} catch(e) { |
111 |
console.error(e); |
|
111 |
console.error("Haketilo:", e);
|
|
112 | 112 |
var policy = fallback_policy(); |
113 | 113 |
} |
114 | 114 |
#ELSE |
content/policy_enforcing.js | ||
---|---|---|
224 | 224 |
* blocked and unable to redefine properties, anyway. |
225 | 225 |
*/ |
226 | 226 |
if (Object.getOwnPropertyDescriptor(element.wrappedJSObject, attr)) { |
227 |
console.error("Redefined property on a DOM object! The page might have bypassed our script blocking measures!"); |
|
227 |
console.error("Haketilo: Redefined property on a DOM object! The page might have bypassed our script blocking measures!");
|
|
228 | 228 |
continue; |
229 | 229 |
} |
230 | 230 |
element.wrappedJSObject[attr] = null; |
... | ... | |
348 | 348 |
if (registrations.length === 0) |
349 | 349 |
return; |
350 | 350 |
|
351 |
console.warn("Service Workers detected on this page! Unregistering and reloading."); |
|
351 |
console.warn("Haketilo: Service Workers detected on this page! Unregistering and reloading.");
|
|
352 | 352 |
|
353 | 353 |
try { |
354 | 354 |
await Promise.all(registrations.map(r => r.unregister())); |
... | ... | |
369 | 369 |
try { |
370 | 370 |
await _disable_service_workers() |
371 | 371 |
} catch (e) { |
372 |
console.debug("Exception thrown during an attempt to detect and disable service workers.", e);
|
|
372 |
console.warn("Haketilo: Exception thrown during an attempt to detect and disable service workers.", e);
|
|
373 | 373 |
} |
374 | 374 |
} |
375 | 375 |
|
html/DOM_helpers.js | ||
---|---|---|
110 | 110 |
try { |
111 | 111 |
on_show_cb(); |
112 | 112 |
} catch(e) { |
113 |
console.error(e); |
|
113 |
console.error("Haketilo:", e);
|
|
114 | 114 |
} |
115 | 115 |
|
116 | 116 |
return true; |
... | ... | |
125 | 125 |
try { |
126 | 126 |
on_hide_cb(); |
127 | 127 |
} catch(e) { |
128 |
console.error(e); |
|
128 |
console.error("Haketilo:", e);
|
|
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
return true; |
html/install.js | ||
---|---|---|
105 | 105 |
|
106 | 106 |
work.err = function (error, user_message) { |
107 | 107 |
if (error) |
108 |
console.error(error);
|
|
108 |
console.error("Haketilo:", error);
|
|
109 | 109 |
work.is_ok = false; |
110 | 110 |
work.reject_cb(user_message); |
111 | 111 |
} |
... | ... | |
392 | 392 |
try { |
393 | 393 |
await haketilodb.save_items(data); |
394 | 394 |
} catch(e) { |
395 |
console.error(e); |
|
395 |
console.error("Haketilo:", e);
|
|
396 | 396 |
const msg = "Error writing to Haketilo's internal database :("; |
397 | 397 |
var dialog_prom = dialog.error(this.dialog_ctx, msg); |
398 | 398 |
} |
html/item_list.js | ||
---|---|---|
145 | 145 |
try { |
146 | 146 |
await list_ctx.remove_cb(identifier); |
147 | 147 |
} catch(e) { |
148 |
console.error(e); |
|
148 |
console.error("Haketilo:", e);
|
|
149 | 149 |
dialog.error(list_ctx.dialog_ctx, `Couldn't remove '${identifier}' :(`) |
150 | 150 |
} |
151 | 151 |
} |
html/payload_create.js | ||
---|---|---|
199 | 199 |
dialog.info(form_ctx.dialog_ctx, "Successfully saved payload!"); |
200 | 200 |
clear_form(form_ctx); |
201 | 201 |
} catch(e) { |
202 |
console.error(e); |
|
202 |
console.error("Haketilo:", e);
|
|
203 | 203 |
dialog.error(form_ctx.dialog_ctx, "Failed to save payload :("); |
204 | 204 |
} |
205 | 205 |
|
html/popup.js | ||
---|---|---|
59 | 59 |
try { |
60 | 60 |
return (await promise)[0]; |
61 | 61 |
} catch(e) { |
62 |
console.log(e); |
|
62 |
console.log("Haketilo:", e);
|
|
63 | 63 |
} |
64 | 64 |
} |
65 | 65 |
|
... | ... | |
157 | 157 |
else |
158 | 158 |
var page_info = await get_page_info(tab_id); |
159 | 159 |
} catch(e) { |
160 |
console.error(e); |
|
160 |
console.error("Haketilo:", e);
|
|
161 | 161 |
} |
162 | 162 |
|
163 | 163 |
if (page_info) { |
html/repo_query.js | ||
---|---|---|
96 | 96 |
const schema = haketilo_schemas[$id]; |
97 | 97 |
const result = haketilo_validator.validate(response.json, schema); |
98 | 98 |
if (result.errors.length > 0) { |
99 |
console.error(result.errors); |
|
99 |
console.error("Haketilo:", result.errors);
|
|
100 | 100 |
|
101 | 101 |
const reg = new RegExp(schema.properties.$schema.pattern); |
102 | 102 |
if (response.json.$schema && !reg.test(response.json.$schema)) |
html/settings.js | ||
---|---|---|
150 | 150 |
try { |
151 | 151 |
await haketilodb.get(); |
152 | 152 |
} catch(e) { |
153 |
console.error(e); |
|
153 |
console.error("Haketilo:", e);
|
|
154 | 154 |
show_indexeddb_error(); |
155 | 155 |
return; |
156 | 156 |
} |
Also available in: Unified diff
prepend all generated console messages with 'Haketilo:'