It turns out that jQuery's empty method can be really slow in Firefox, which can freeze the browser when cleaning the log.