I need some function returning a boolean value to check if the browser is Chrome.
How do I create such functionality?
var is_chrome = browseris.chrome
or check ather browsers:
browseris.firefox
browseris.ie
browseris.safari
and olso you can check the version like browseris.chrome7up and etc.
check all existing information in the 'browseris' object
all answers are wrong. "Opera" and "Chrome" are same in all cases.
(edited part)
here is the right answer
if (window.chrome && window.chrome.webstore) {
// this is Chrome
}
User could change user agent . Try testing for webkit prefixed property in style object of body element
if ("webkitAppearance" in document.body.style) {
// do stuff
}