diff --git a/4chan_x.user.js b/4chan_x.user.js index 15a9f4668..a0be5308f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1247,6 +1247,7 @@ if (this.src !== 'about:blank') return setTimeout(loadChecking, 500, this); }); $.add(d.body, iframe); + window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})'; if (conf['Persistent QR']) { qr.dialog(); if (conf['Auto Hide QR']) qr.hide(); @@ -1254,8 +1255,7 @@ $.on(d, 'dragover', qr.dragOver); $.on(d, 'drop', qr.dropFile); $.on(d, 'dragstart', qr.drag); - $.on(d, 'dragend', qr.drag); - return window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})'; + return $.on(d, 'dragend', qr.drag); }, node: function(root) { return $.on($('.quotejs + .quotejs', root), 'click', qr.quote); @@ -1588,7 +1588,7 @@ return _this.count(arr.length); }); this.count($.get('captchas', []).length); - return this.load(); + return this.reload(); }, save: function() { var captcha, captchas, response; diff --git a/changelog b/changelog index c17d6c637..a68751591 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,6 @@ master - Mayhem + Ensure fresh captcha on QR load. Fix unXXXifier on pages starting with not XXXed numbers. Update image limit notifier for /vg/. diff --git a/script.coffee b/script.coffee index a24e4dc7c..bbe210245 100644 --- a/script.coffee +++ b/script.coffee @@ -912,6 +912,8 @@ qr = $.on iframe, 'load', -> unless @src is 'about:blank' then setTimeout loadChecking, 500, @ $.add d.body, iframe + # Prevent original captcha input from being focused on reload. + window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})' if conf['Persistent QR'] qr.dialog() qr.hide() if conf['Auto Hide QR'] @@ -919,8 +921,6 @@ qr = $.on d, 'drop', qr.dropFile $.on d, 'dragstart', qr.drag $.on d, 'dragend', qr.drag - # prevent original captcha input from being focused on reload - window.location = 'javascript:void(Recaptcha.focus_response_field=function(){})' node: (root) -> $.on $('.quotejs + .quotejs', root), 'click', qr.quote @@ -1187,7 +1187,8 @@ qr = $.on @challenge, 'DOMNodeInserted', => @load() $.sync 'captchas', (arr) => @count arr.length @count $.get('captchas', []).length - @load() + # start with an uncached captcha + @reload() save: -> return unless response = @input.value captchas = $.get 'captchas', []