How to check flash player installed and enabled or not in IE and Chrome

I need to check if Flash Player is installed and enabled or not in IE / Chrome.

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

and

!!(navigator.mimeTypes["application/x-shockwave-flash"] || window.ActiveXObject && new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));

Both options are suitable for all browsers in all operating systems except Chrome. For chrome it gives true even if I disabled Flash Player. But for IE, it behaves differently on different systems that don't work in IE6 at all. How to check for IE / Chrome if flash is installed and enabled.

+4
source share
2 answers

Too tired to write everything, so here is a fiddle with some flash / silver detection that I wrote some time ago. Feel free to play with it and remove the silverlight element if you don't need it.

It basically boils down to scrolling through all the plugins in this way:

 function get (name) { for (var i = 0, l = navigator.plugins.length; i < l; i++) { if (navigator.plugins[i].name === name) { return navigator.plugins[i]; } } return undefined; } 

http://jsfiddle.net/nQ7fk/

+3
source

I think you may have already made this decision, but I would recommend using swfobject to control flash insertion:

It has functions that allow you to determine whether a flash drive is installed, and can also initiate the installation process and manage the general installation of flash memory in a cross-browser compatible with standards.

+2
source

Source: https://habr.com/ru/post/1490710/


All Articles