From a817de9180dba60ef3478529e0fbf654354113ca Mon Sep 17 00:00:00 2001 From: Kabir Sala Date: Thu, 27 Feb 2014 21:11:08 +0100 Subject: [PATCH] Remove moot ads, #15 --- builds/4chan-X.user.js | 2 ++ builds/crx/script.js | 2 ++ src/Posting/QR.coffee | 2 ++ 3 files changed, 6 insertions(+) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index cfcde66b5..d9be7aa47 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6349,6 +6349,8 @@ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') { if (/mistyped/i.test(err.textContent)) { err = 'You seem to have mistyped the CAPTCHA.'; + } else if (/expired/i.test(err.textContent)) { + err = 'This CAPTCHA is no longer valid because it has expired.'; } QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false; QR.cooldown.set({ diff --git a/builds/crx/script.js b/builds/crx/script.js index b87014ea9..db979a30e 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6374,6 +6374,8 @@ if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') { if (/mistyped/i.test(err.textContent)) { err = 'You seem to have mistyped the CAPTCHA.'; + } else if (/expired/i.test(err.textContent)) { + err = 'This CAPTCHA is no longer valid because it has expired.'; } QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false; QR.cooldown.set({ diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 18b8c806d..36bc081ba 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -710,6 +710,8 @@ QR = # Remove the obnoxious 4chan Pass ad. if /mistyped/i.test err.textContent err = 'You seem to have mistyped the CAPTCHA.' + else if /expired/i.test err.textContent + err = 'This CAPTCHA is no longer valid because it has expired.' # Enable auto-post if we have some cached captchas. QR.cooldown.auto = if QR.captcha.isEnabled !!QR.captcha.captchas.length