Hi chuang108,
To add to the above answer, if you are trying to working on an Intranet application and if it is in your power than you can ask your end users to add the site in Trusted Sites Zone. After that this script will hide address bar easily.
Regards,
Chinmay