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.
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.
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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With