aboutsummaryrefslogtreecommitdiff
path: root/src/docs-google-com-fix-forms/google_forms.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-17 12:38:44 +0200
committerWojtek Kosior <koszko@koszko.org>2022-08-17 12:38:44 +0200
commit7e0bcba919b0bb27f8131f3a9acc0cc2bd2e5764 (patch)
treec7b6aee900fe502a13a1e3fce924d979057e40ba /src/docs-google-com-fix-forms/google_forms.js
parent287b3a99e22bb5cd207719879cedf8bdc439b676 (diff)
downloadhydrilla-fixes-bundle-7e0bcba919b0bb27f8131f3a9acc0cc2bd2e5764.tar.gz
hydrilla-fixes-bundle-7e0bcba919b0bb27f8131f3a9acc0cc2bd2e5764.zip
[Google Forms] Support forms with reCAPTCHA
Diffstat (limited to 'src/docs-google-com-fix-forms/google_forms.js')
-rw-r--r--src/docs-google-com-fix-forms/google_forms.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/docs-google-com-fix-forms/google_forms.js b/src/docs-google-com-fix-forms/google_forms.js
index 4652426..73d6840 100644
--- a/src/docs-google-com-fix-forms/google_forms.js
+++ b/src/docs-google-com-fix-forms/google_forms.js
@@ -82,7 +82,19 @@ document.querySelectorAll('[jsname=LwH6nd]').forEach(n => n.remove());
/* Enable the form sumbission button (if any). */
for (const submit_but of document.querySelectorAll('[jsname=M2UYVd]'))
- submit_but.addEventListener("click", () => form.submit());
+ submit_but.addEventListener("click", () => {
+ /*
+ * hacktcha_completed() will be defined by google-forms-hacktcha.js but only
+ * if we have the actual captcha support enabled. It will return true if
+ * we're already authenticated.
+ */
+ if (typeof window.hacktcha_completed === "function") {
+ if (!window.hacktcha_completed())
+ return;
+ }
+
+ form.submit()
+ });
/* Enable the "next page" button (if any). */
function goToNext()
@@ -109,6 +121,5 @@ for (const warning of
* support dropdown inputs
* support "other" radio buttons and "other" checkbox buttons, in which the
user types text in addition to selecting the "other" box
- * support reCAPTCHA integration
* support displaying public analytics ("viewanalytics" instead of "viewform")
*/