added support for chrome and safari

I have added browser support for chrome and safari. Before the script was detecting chrome and safari as Firefox and not giving the correct result.