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

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -