JSFiddle - React, Tailwind, and code Playground
by tonyleeper
JavaScript
function isSilverlightInstalled() {
var isSilverlightInstalled = false;
try {
//check on IE
try {
var slControl = new ActiveXObject('AgControl.AgControl');
isSilverlightInstalled = true;
} catch (e) {
//either not installed or not IE. Check Firefox
if ( navigator.plugins["Silverlight Plug-In"] ) {
isSilverlightInstalled = true;
}
}
} catch (e) {
//we don't want to leak exceptions. However, you may want
//to add exception tracking code here.
}
return isSilverlightInstalled;
}
if (isSilverlightInstalled()) {
document.body.innerHTML = 'Silverlight is installed on this browser';
} else {
document.body.innerHTML = 'Silverlight is NOT installed on this browser';
}
function isJavaAvailable() {
var javaRegex = /(Java)(\(TM\)| Deployment)/,
plugins = navigator.plugins;
if (navigator && plugins) {
for (plugin in plugins){
if(plugins.hasOwnProperty(plugin) &&
javaRegex.exec(plugins[plugin].name)) {
return true;
}
}
}
return false;
}
if (isJavaAvailable()) {
document.body.innerHTML = document.body.innerHTML + '<br />' + 'Java is available on this browser';
} else {
document.body.innerHTML = document.body.innerHTML + '<br />' + 'Java is NOT available on this browser';
}