Issue
I need some function returning a boolean value to check if the browser is Chrome.
How do I create such functionality?
Solution
Update: Please see Jonathan's answer for an updated way to handle this. The answer below may still work, but it could likely trigger some false positives in other browsers.
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
However, as mentioned User Agents can be spoofed so it is always best to use feature-detection (e.g. Modernizer) when handling these issues, as other answers mention.
Answered By - Rion Williams
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.