Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check flash plugin is blocked in Chrome

How can I check using jquery or javascript whether flash plugin is blocked in chrome?

We can check for disabled flash plugin using below

((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));

In Chrome you can disable plugin individually by clicking on disable individual plugin. Then if we disable plugin individually, above query works and return false. But If we block all plugin it will return true only.Hence my concern is how to detect a plugin has been blocked.

like image 990
Gaurav Pant Avatar asked Jul 18 '13 15:07

Gaurav Pant


People also ask

Is Flash blocked on Chrome?

As of 2021, Adobe has ended support for the Flash Player plugin. Flash content, including audio and video, will no longer play back in any version of Chrome. Visit the Chrome blog to learn more.


1 Answers

You could use something like swfobject to handle flash detection, but something like this should also work;

var flashAvailable = false;
try {
  var flash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
  if(flash) {
    flashAvailable = true;
  }
}
catch(e) {
  if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) {
    flashAvailable = true;
  }
}
like image 125
intuitivepixel Avatar answered Oct 26 '22 00:10

intuitivepixel