From f595c1ed683cbf6bc1e12307ff99f45ca029cdff Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 19 Dec 2019 12:57:55 -0800 Subject: [PATCH] Display message when noscript captcha is disabled. #2500 --- src/Posting/Captcha.fixes.coffee | 2 ++ src/Posting/Captcha.replace.coffee | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/Posting/Captcha.fixes.coffee b/src/Posting/Captcha.fixes.coffee index 765d57fd3..991b4ba28 100644 --- a/src/Posting/Captcha.fixes.coffee +++ b/src/Posting/Captcha.fixes.coffee @@ -79,6 +79,8 @@ Captcha.fixes = {token} else if $('.fbc-imageselect-challenge > form') {working: true} + else if (ns = $ 'noscript') and /please enable javascript/i.test(ns.textContent) + {disabled: true} else null new Connection(window.parent, '*').send data if data diff --git a/src/Posting/Captcha.replace.coffee b/src/Posting/Captcha.replace.coffee index 2d5b2fb34..b96b236dc 100644 --- a/src/Posting/Captcha.replace.coffee +++ b/src/Posting/Captcha.replace.coffee @@ -47,3 +47,7 @@ Captcha.replace = break if (textarea = $ 'textarea', node) textarea.value = token $.event 'input', null, textarea + disabled: -> + msg = $.el 'div', + <%= html('Noscript captcha seems to be disabled on 4chan.
You may be able to post if you uncheck "Force Noscript Captcha" in your settings.') %> + new Notice 'warning', msg