aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-06-20 19:41:25 +0200
committerWojtek Kosior <koszko@koszko.org>2022-06-20 19:41:25 +0200
commita0740ca80334d4668ee57139e14fb933e10a3bcc (patch)
treef0ce576001464c9a7397c6175d4cee99ea9e2f2f
parentf96db98aa2652e48c97e81d70e1392fa23bcdbfc (diff)
downloadhacktcha-a0740ca80334d4668ee57139e14fb933e10a3bcc.tar.gz
hacktcha-a0740ca80334d4668ee57139e14fb933e10a3bcc.zip
remove unneeded debugging output to console
-rw-r--r--captcha-child-bframe.js24
-rw-r--r--captcha-demo.js2
2 files changed, 1 insertions, 25 deletions
diff --git a/captcha-child-bframe.js b/captcha-child-bframe.js
index f113850..7f595c4 100644
--- a/captcha-child-bframe.js
+++ b/captcha-child-bframe.js
@@ -345,7 +345,6 @@ function protobuf_craft_message(data) {
[6, "reason"],
[14, "site_key"]
]) {
- console.warn("data", key, data[key]);
const value_bin = encoder.encode(data[key]);
/* Wire type of 2 indicates a length-delimited field. */
@@ -434,15 +433,12 @@ function update_api_helper_rresp(api_helper, rresp) {
}
function update_api_helper_dresp(api_helper, dresp) {
- console.debug("updating with dresp", dresp);
const updated_params = {
token: dresp[1],
p_param: dresp[5],
image_id: (dresp[2] || [null])[0]
};
- console.debug("after:", new APIHelper(updated_params, api_helper));
-
return new APIHelper(updated_params, api_helper);
}
@@ -453,7 +449,6 @@ async function ajax_replaceimage(api_helper, partial_solution) {
post_data.append("ds", JSON.stringify(partial_solution));
const api_url = api_helper.make_api_url("replaceimage", ["site_key"]);
- console.debug("replaceimage url", api_url, api_helper);
const response = await fetch(api_url, {
method: "POST",
@@ -490,7 +485,7 @@ function make_captcha_goal(meta) {
if (to_select) {
return `Select all squares with: "${to_select}".`;
} else {
- console.warn("Cannot deduce goal", meta);
+ console.warn("Cannot deduce goal. Metadata:", meta);
return `Cannot decude this challenge's goal :(`;
}
@@ -519,8 +514,6 @@ challenge_handlers.dynamic = async function(api_helper, pmeta) {
DEFAULT_TIMEOUT_MILLIS);
for await (const click of hacktcha_iterate(clicks, () => api_helper)) {
- console.debug("clicked", click);
-
remove_tile_img(...click);
const tile_index = click[0] * col_count + click[1];
@@ -550,8 +543,6 @@ challenge_handlers.multicaptcha = async function(api_helper, pmeta) {
throw new Error("Could not extract challenge metadata.", pmeta);
}
- console.debug("multicaptcha metas", metas);
-
show_main_view("main_tiles_challenge");
tile_challenge_reset();
@@ -560,7 +551,6 @@ challenge_handlers.multicaptcha = async function(api_helper, pmeta) {
while (metas.length > 0) {
const meta = metas.splice(0, 1)[0];
- console.debug("multicaptcha current meta", meta);
const row_count = meta[3], col_count = meta[4];
show_goal(make_captcha_goal(meta));
@@ -574,8 +564,6 @@ challenge_handlers.multicaptcha = async function(api_helper, pmeta) {
const clicks = show_img(img_url, row_count, col_count, timeout);
for await (const click of hacktcha_iterate(clicks, () => api_helper)) {
- console.debug("clicked", click);
-
const clicked_id = click[0] * col_count + click[1];
if (clicked_imgs.has(clicked_id)) {
@@ -609,15 +597,8 @@ challenge_handlers.doscaptcha = function(api_helper, pmeta) {
challenge_handlers.default = challenge_handlers.doscaptcha;
async function handle_challenge(api_helper, rresp) {
- console.debug("token", rresp[1]);
-
const pmeta = rresp[4];
- console.debug("pmeta", pmeta);
-
const challenge_type = rresp[5];
- console.debug("challenge type", challenge_type);
-
- console.debug("p_param", rresp[9]);
if (!challenge_handlers.hasOwnProperty(challenge_type))
throw new Error("Unsupported challenge type", challenge_type);
@@ -628,8 +609,6 @@ async function handle_challenge(api_helper, rresp) {
async function ajax_reload(api_helper) {
const url = api_helper.make_api_url("reload", ["site_key"]);
- console.debug("POST", url, api_helper.make_reload_message());
-
const response = await fetch(url, {
method: "POST",
body: api_helper.make_reload_message(),
@@ -728,7 +707,6 @@ async function main() {
const final_token =
await get_final_token(site_key, rc_version, initial_token);
- console.info("got grecaptcha_token", final_token);
window.parent.postMessage(final_token, origin);
}
diff --git a/captcha-demo.js b/captcha-demo.js
index 2f85545..28d331d 100644
--- a/captcha-demo.js
+++ b/captcha-demo.js
@@ -30,8 +30,6 @@
const token = await HCHA.run(demo_div, demo_site_key);
- console.debug("parent got token", token);
-
const token_field = document.createElement("textarea");
demo_div.after(token_field);