diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-08-17 12:38:44 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-08-17 12:38:44 +0200 |
commit | 7e0bcba919b0bb27f8131f3a9acc0cc2bd2e5764 (patch) | |
tree | c7b6aee900fe502a13a1e3fce924d979057e40ba /src/docs-google-com-fix-forms/google_forms.js | |
parent | 287b3a99e22bb5cd207719879cedf8bdc439b676 (diff) | |
download | hydrilla-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.js | 15 |
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") */ |