Fix history issues on Chrome, it apparently doesn't like void() in the window.location. Close #241.

This commit is contained in:
Nicolas Stepien 2012-02-18 23:00:31 +01:00
parent 342aef9e3a
commit 164ebe23d1
2 changed files with 10 additions and 3 deletions

View File

@ -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();

View File

@ -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']