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.
The only way I could think of checking if the browser is blocking the plugin is to make a call to the plugin and see if it returns. In your case, these steps:
Because it's a browser security thing you do not have direct access to an api that can tell you if your desired plugin is being blocked. I think this may be the only solution available right now. Also note, that the latest version of chrome (54.0.2840.59 right now) chrome is blocking all flash if it's running in an iframe.
You could use something like swfobject to handle flash detection, but something like this should also work;
I have found that the only reliable method is to get the individual Flash element to alert the browser that it is enabled, ie. that it is not blocked.
I do this using the following code at the start of my Flash file:
This then triggers a JavaScript function in the browser:
Remember that this wont trigger right away, only once the Flash has loaded and started to run.