jbutko
10/29/2015 - 11:59 AM

#JS: Check if Flash player is enabled/disabled with #javaScript

#JS: Check if Flash player is enabled/disabled with #javaScript

function checkFlashSupport() {
  var hasFlash = false;
  
  try {
    hasFlash = Boolean(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
  } catch(exception) {
      hasFlash = ('undefined' != typeof navigator.mimeTypes['application/x-shockwave-flash']);
  }
  
  return hasFlash;
}


// via From http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-inf