Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
// Modern Browsers
function detectPlugin( substrs ) {
    if (navigator.plugins) {
      
        for (var i = 0, l = navigator.plugins.length; i < l; i++) {
          
            var plugin = navigator.plugins[i],
                haystack = plugin.name + plugin.description,
                found = 0;
            for (var j = 0; j < substrs.length; j++) {
              
                if ( haystack.indexOf(substrs[j]) != -1 )   found++;
            }
            
            if ( found == substrs.length ) return true;
        }
    }
    return false;
}
// IE
function detectObject(progIds) {
    for (var i = 0; i < progIds.length; i++) {
        try {
            var obj = new ActiveXObject(progIds[i]);
          if ( obj ) return true;
        } catch (e) {
            // Ignore
        }
    }
    return false;
}
var detectFlash = [ "Shockwave", "Flash" ];
if ( detectPlugin( detectFlash ) || detectObject( detectFlash ) ) alert( 'yay' );
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers