Check if the browser is Firefox -


i need know if browser running page firefox. came across code below:

 var isgecko = (navigator.product == 'gecko'); 

but true firefox , safari.

only firefox has string "firefox" in user agent, easy as

var isfirefox = (navigator.useragent.indexof('firefox') !== -1); 

edit: yes, mozilla discourages it


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -