How to detect Firefox in JavaScript?
I want to detect all versions of Firefox.
This will detect any version of Firefox:
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
more specifically:
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
// Do Firefox-related activities
}
You may want to consider using feature-detection ala Modernizr, or a related tool, to accomplish what you need.