Fixed an issue that occurs when window.onload is overwritten by the web page.