diff --git a/4chan_x.user.js b/4chan_x.user.js index 351d3c6ad..b938c53a8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1265,7 +1265,7 @@ qr = { init: function() { - var form, iframe, link, loadChecking, script; + var form, iframe, link, loadChecking; if (!$.id('recaptcha_challenge_field_holder')) return; if (conf['Hide Original Post Form']) { link = $.el('h1', { @@ -1306,11 +1306,14 @@ }); $.add(d.head, iframe); } - script = $.el('script', { - textContent: 'Recaptcha.focus_response_field=function(){}' + setTimeout(function() { + var script; + script = $.el('script', { + textContent: 'Recaptcha.focus_response_field=function(){}' + }); + $.add(d.head, script); + return $.rm(script); }); - $.add(d.head, script); - $.rm(script); if (conf['Persistent QR']) { qr.dialog(); if (conf['Auto Hide QR']) qr.hide(); diff --git a/script.coffee b/script.coffee index 992ba5366..59c62feb7 100644 --- a/script.coffee +++ b/script.coffee @@ -1036,10 +1036,12 @@ qr = $.on iframe, 'load', -> if @src isnt 'about:blank' then setTimeout loadChecking, 500, @ $.add d.head, iframe - # Prevent original captcha input from being focused on reload. - script = $.el 'script', textContent: 'Recaptcha.focus_response_field=function(){}' - $.add d.head, script - $.rm script + # This is extemely slow, execute is asynchronously. + setTimeout -> + # Prevent original captcha input from being focused on reload. + script = $.el 'script', textContent: 'Recaptcha.focus_response_field=function(){}' + $.add d.head, script + $.rm script if conf['Persistent QR'] qr.dialog()