My requirement is I need to check whether Chrome browser is insatlled on the client machine or not using Javascript. I have searched on the net not able to find the way out. Please help in getting this done.
Asked
Active
Viewed 1,336 times
0
-
Whether the page is being viewed in Chrome or whether the program is installed on the client machine? – aphextwix Jun 22 '15 at 16:24
-
I would imagine the only way you can tell is if the code itself is running in Chrome already. Allowing that sort of level of access to a system from JavaScript would be a security/privacy nightmare. – James Thorpe Jun 22 '15 at 16:26
-
I need to check whether the program is installed on client machine – Sk Manolya Jun 22 '15 at 16:27
-
sample snippet would be of grate help – Sk Manolya Jun 22 '15 at 16:28
-
From a browser window or from a nodejs like app? From a browser window you can't. – GillesC Jun 22 '15 at 16:30
-
possible duplicate of [Check whether user has a Chrome extension installed](http://stackoverflow.com/questions/6293498/check-whether-user-has-a-chrome-extension-installed) – Rahul Tripathi Jun 22 '15 at 16:33
3 Answers
1
You can't do that with JavaScript, and even if you could, you shouldn't.
JavaScript on the client doesn't have access to the user's system, for very good reasons. (Think, servers with bad intentions.)
Josh Beam
- 18,506
- 2
- 39
- 68
0
You can check if the browser is Chrome with the next code
if(!window.chrome){
//Chrome code
}else{
// Chrome block
}
LGtheCat
- 23
- 4
0
You can't. Not with JavaScript. However, you can check whether the browser that is currently being used to view your webpage is Google Chrome or not.
<script type="text/javascript">
if(window.chrome){
document.write("Browser is Chrome");
}
else{
document.write("Please download Chrome");
}
</script>