aboutsummaryrefslogtreecommitdiff
path: root/captcha-child-bframe.js
diff options
context:
space:
mode:
Diffstat (limited to 'captcha-child-bframe.js')
-rw-r--r--captcha-child-bframe.js29
1 files changed, 25 insertions, 4 deletions
diff --git a/captcha-child-bframe.js b/captcha-child-bframe.js
index 7f595c4..0a5b20d 100644
--- a/captcha-child-bframe.js
+++ b/captcha-child-bframe.js
@@ -58,6 +58,11 @@ const replacement_markup = `
background-color: white;
}
+ h4 {
+ margin-bottom: 10px;
+ margin-top: 10px;
+ }
+
#tiles_table, #tiles_body td {
border: 1px solid white;
padding: 0;
@@ -94,6 +99,12 @@ const replacement_markup = `
</style>
</head>
<body>
+ <div>
+ Google policies:
+ <a href="https://www.google.com/intl/en/policies/privacy/">privacy</a>
+ &amp;
+ <a href="https://www.google.com/intl/en/policies/terms/">terms</a>
+ </div>
<div id="main_loading">
<h4>
Loading Hacktcha - a libre client for reCAPTCHA.
@@ -103,7 +114,7 @@ const replacement_markup = `
<h4>
Challenge timed out.
</h4>
- <button id="resume_but">Resume</button>
+ <button class="retry_but">Reload Hacktcha</button>
</div>
<div id="main_challenge_blocked" class="hide">
<h4>
@@ -596,6 +607,8 @@ challenge_handlers.doscaptcha = function(api_helper, pmeta) {
challenge_handlers.default = challenge_handlers.doscaptcha;
+challenge_handlers.null = challenge_handlers.doscaptcha;
+
async function handle_challenge(api_helper, rresp) {
const pmeta = rresp[4];
const challenge_type = rresp[5];
@@ -674,8 +687,16 @@ async function get_final_token(site_key, rc_version, token) {
show_main_view("main_timed_out");
- const resume_but = document.getElementById("resume_but");
- await new Promise(cb => resume_but.onclick = cb);
+ /*
+ * Resuming after timeout does not work, so we allow the user to reload the
+ * iframe instead.
+ * TODO: fix resuming
+ */
+
+ /* const resume_but = document.getElementById("resume_but"); */
+ /* await new Promise(cb => resume_but.onclick = cb); */
+
+ return new Promise(() => {});
} else if (e.hacktcha_error === "challenge_blocked") {
show_main_view("main_challenge_blocked");
@@ -702,7 +723,7 @@ async function main() {
document.close();
for (const but of document.getElementsByClassName("retry_but"))
- but.onclick = () => window.postMessage("recreate_frame", origin);
+ but.onclick = () => window.parent.postMessage("recreate_frame", origin);
const final_token =
await get_final_token(site_key, rc_version, initial_token);