diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 02588d22b..4c4238b4a 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -26,10 +26,13 @@ Captcha.v2 = $.queueTask => @save false initFrame: -> - $.on window, 'focus', -> - $.queueTask -> - return unless d.hasFocus() and (checkbox = $.id 'recaptcha-anchor') - checkbox.focus() unless d.activeElement is checkbox + $.onExists d.body, '#recaptcha-anchor', true, (checkbox) -> + focus = -> + if d.hasFocus() and d.activeElement isnt checkbox + checkbox.focus() + focus() + $.on window, 'focus', -> + $.queueTask focus shouldFocus: false timeouts: {}