On Firefox, clicking a bookmarklet will cause the page to display the last return value of the bookmarklet, deleting the rest of the page contents. The solution is to add undefined; at the end.