diff --git a/4chan_x.user.js b/4chan_x.user.js index 57b17b053..5b3a240ee 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1208,7 +1208,7 @@ qr = { init: function() { - var form, iframe, link, loadChecking; + var form, iframe, link, loadChecking, script; if (!$.id('recaptcha_challenge_field_holder')) return; if (conf['Hide Original Post Form']) { link = $.el('h1', { @@ -1250,7 +1250,11 @@ }); $.add(d.body, iframe); } - window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})'; + script = $.el('script', { + textContent: 'Recaptcha.focus_response_field=function(){}' + }); + $.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 34c9667dc..f81e12111 100644 --- a/script.coffee +++ b/script.coffee @@ -917,7 +917,10 @@ qr = $.add d.body, iframe # Prevent original captcha input from being focused on reload. - window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})' + script = $.el 'script', textContent: 'Recaptcha.focus_response_field=function(){}' + $.add d.head, script + $.rm script + if conf['Persistent QR'] qr.dialog() qr.hide() if conf['Auto Hide QR']