Created
July 13, 2015 14:41
-
-
Save towerofnix/92eed963e4638e19538a to your computer and use it in GitHub Desktop.
Detect some plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plugins = navigator.plugins; | |
var hasUnity = false; | |
var hasJavaApplet = false; | |
var hasFlash = false; | |
var hasSilverlight = false; | |
for (var i = 0; i < plugins.length; i++) { | |
//console.log("%c"+plugins[i].name+"%c "+plugins[i].description, "font-weight: 800", "font-weight: default"); | |
if(plugins[i].name==="Unity Player") hasUnity = true; | |
if(plugins[i].name==="Java Applet Plug-in") hasJavaApplet = true; | |
if(plugins[i].name==="Shockwave Flash") hasFlash = true; | |
if(plugins[i].name==="Silverlight Plug-In") hasSilverlight = true; | |
} | |
console.log("Has Unity?", hasUnity); | |
console.log("Has Java Applet?", hasJavaApplet); | |
console.log("Has Shockwave Flash?", hasFlash); | |
console.log("Has MS Silverlight?", hasSilverlight); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment