Made the script compatible with chrome. Thanks @langer :D