SwfObject - flash detection without message "Allow start ..." firefox

I use swfobject in one of my projects to determine if the end user has installed the installed version of Flash. The problem is with Firefox because it displays a message: "Allow Adobe Flash to run?" and I want to avoid this.

Not about showing the end user alternative content, I just want to try to detect Flash and if Flash is not installed, do not show anything, but if Flash is installed, then do not show Allow to run ... messages in Firefox.

Does anyone know of any way to prevent this with SwfObject?

Note: By simply including the following line in the html header:

<script type="text/javascript" src="swfobject.js"></script> 

it launches the message "Allow start": S

If you think that there is a better alternative to swfobject to solve this problem, and it is a good multi-purpose swf-handler tool, I’m all ears.

Here is an example post:

enter image description here

thanks

+8
javascript firefox flash swfobject
source share
2 answers

Something like:

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

Not sure if you need to check all browsers or just some so that you can remove activeX checks.

+3
source share

mimeType navigator represents a plugin object . You can use this to scroll and capture the details of any plugin that is included in the browser.

Example:

The navigator.mimeTypes call returns an array of plugin objects.

FYI: if the user has the plugin disabled, he will not appear in this array.

The simplest logic is simply to search for a description of the shock wave.

 var plugins = navigator.mimeTypes; var i; for(i = 0 ; i < plugins.length ; i++){ var pluginName = plugins[i].description.toLowerCase() if(pluginName.indexOf('shockwave') > -1){ console.log(pluginName + ' : flash in enabled') break; } } 

paste this script into any console.

Hope this helps

+2
source share

All Articles