I've used the code below if I need to detect Firefox:
var firefox = !(window.mozInnerScreenX == null);
I'm curious if there is something similar to detect webkit browsers without checking the user agent string. Like checking a specific feature only webkit browsers have?
Go to the console in Chrome and type window.webkit
- the autocompletion will show you a stack of properties that should be Webkit specific (e.g. webkitRequestAnimationFrame
, webkitAudioContext
, etc)