First of all, sorry for ressurrecting this question here. I've been trying for two days how to reach this job using javascript/jquery and i think i've read all stack overflow and other blogs posts about that, so please, don't mark it as duplicated because I can't use out-dated scripts from 2012 now in 2017.
I've a single page that redirects to a third party e-learning platform where some content needs flash to work. Many users don't care about which software is installed on their machines (what a new, huh) so i need to detect it and show the tipical message "please install/update flash player clicking here", but i cannot find a "modern" script/way to do this, in any place, simplified, if possible.
All scripts i've tried are deprecated or returns false in all browsers, even i've newest version of flash installed and active.
Anny help will be appreciated (except links to older posts or scripts that don't work nowadays, obviously).
Thanks a lot!
How to detect flash is installed or not using JavaScript ? The task is to detect whether the user has installed Adobe Flash player or not with the help of JavaScript. we’re going to discuss 2 techniques. Create a ShockwaveFlash.ShockwaveFlash object. If the instance’s value is true, Flash is installed.
The task is to detect whether the user has installed Adobe Flash player or not with the help of JavaScript. we’re going to discuss 2 techniques. Create a ShockwaveFlash.ShockwaveFlash object. If the instance’s value is true, Flash is installed. If any error occurred, Use navigator.mimetypes property to know whether the flash is installed.
The YAHOO.util.FlashDetect namespace is used to contain the library within the YAHOO global Object. For more details pertaining to the YUI namespace implementation and dependencies please refer to the YAHOO.namespace documentation.
There is a simple way to check for Flash since all the installed and enabled plugins will be listed in navigator.plugins;
Note that if a plugin is installed, but not enabled, it will not be detected in the navigator.plugins
array. There is NO way to detect this using Javascript (this Question which confirms the same).
Having said that, use the following function isFlashEnabled();
to detect Flash :
<html>
<script>
if(isFlashEnabled())
{ document.write('Flash is installed (but may need to be enabled)'); }
else { document.write('Flash is either not installed or disabled'); }
function isFlashEnabled()
{
var flash = navigator.plugins.namedItem('Shockwave Flash');
if (!flash) { return 0; }
else { return 1; }
}
</script>
<body> <embed src="https://www.w3schools.com/tags/helloworld.swf"> </body>
</html>
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