adjustments to make Firefox behave nicely

Moving append into function and adding this to end of JS:
if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}void(0);