flash detection (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

Setup

var singleLineFlashCheck = function() {
      return (typeof navigator.plugins == "undefined" || navigator.plugins.length == 0) ? !!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) : navigator.plugins["Shockwave Flash"];
  };
  
  var swfFlashCheck = function(){
      return swfobject.getFlashPlayerVersion().major;
  };
  
  var a1 = function() {
      return navigator.mimeTypes["application/x-shockwave-flash"]
  };
  
  var googleFlash = function(){
  var a = !1,
      b = "";
  
  function c(d) {
      d = d.match(/[\d]+/g);
      d.length = 3;
      return d.join(".")
  }
  if (navigator.plugins && navigator.plugins.length) {
      var e = navigator.plugins["Shockwave Flash"];
      e && (a = !0, e.description && (b = c(e.description)));
      navigator.plugins["Shockwave Flash 2.0"] && (a = !0, b = "2.0.0.11")
  } else {
      if (navigator.mimeTypes && navigator.mimeTypes.length) {
          var f = navigator.mimeTypes["application/x-shockwave-flash"];
          (a = f && f.enabledPlugin) && (b = c(f.enabledPlugin.description))
      } else {
          try {
              var g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),
                  a = !0,
                  b = c(g.GetVariable("$version"))
          } catch (h) {
              try {
                  g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"), a = !0, b = "6.0.21"
              } catch (i) {
                  try {
                      g = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"), a = !0, b = c(g.GetVariable("$version"))
                  } catch (j) {}
              }
          }
      }
  }
  var k = b;
  return a || k;
  }

Test runner

Ready to run.

Testing in
TestOps/sec
Mime type (modern)
a1();
ready
Single Line
singleLineFlashCheck();
ready
swfObject
// async test
swfFlashCheck();
ready
Google Flash Detect
googleFlash();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by flash detection on
  • Revision 2: published by Flash detection on
  • Revision 3: published on