I need to know if the browser running my page is Firefox. I came across the code below:
var isGecko = (navigator.product == 'Gecko');
but this is true for Firefox and Safari.
I need to know if the browser running my page is Firefox. I came across the code below:
var isGecko = (navigator.product == 'Gecko');
but this is true for Firefox and Safari.
Only Firefox has the string "Firefox" in the user agent, so it is as easy as
var isFirefox = (navigator.userAgent.indexOf('Firefox') !== -1);
Edit: yes, Mozilla discourages it