Flash Plugin Detector




Plugin Version Precision

The plugin version is detected by the getVersion( ) method. The method will return a value of either null or a string of 4 numbers "Major,Minor,Revision,Build" separated by a comma. Each of these 4 numbers is an integer >=0.

For Internet Explorer, all 4 numbers are always detected.

For all other browsers, you will get either 3 or 4 numbers, depending on the circumstances. For example, if we use this code for the Chrome browser on Windows:

 

var version = PluginDetect.getVersion('Flash');


then version will be null or a string "Major,Minor,Revision,0". The last digit would be zero in this case, because it was not detectable. The detection results were obtained from the navigator.plugins[ ] array, which for Chrome/Windows only reveals the first 3 numbers. [For Firefox on Windows/Mac, the plugins[ ] array will reveal all 4 numbers.]


On the other hand, if we add another input argument to the getVersion( ) method, then the Flash player will be inserted into the DOM and queried directly. If we use this code for the Chrome browser on Windows:

 

var version = PluginDetect.getVersion('Flash', true);


then version will be null or a string "Major,Minor,Revision,Build". All 4 digits are detectable in this particular case.

Note: some browsers do not permit communication between the brower's Javascript and the Flash plugin. In that case, the browser will not be able to query the Flash plugin to get all 4 digits of the plugin version.

Note: some browsers may give you a security popup when you try to run a very outdated version of the Flash player.



A few PluginDetect commands for Flash detection

PluginDetect.getVersion('Flash', instantiate): [Returns string or null]
   Returns the version (as a string) of the installed plugin.
   Returns null when the version could not be determined (when plugin is not installed/not enabled, or plugin is installed but the version information is unavailable).

By default, the returned version string is comma delimited and has the format of "Major,Minor,Revision,Build". If you wish to change the getVersion( ) delimiter, then use:
   PluginDetect.getVersion(delimiter) where delimiter is a string with exactly 1 character.

For example,
   PluginDetect.getVersion(".");   // set delimiter
   var version = PluginDetect.getVersion("Flash");    // version has the format of "Major.Minor.Revision.Build"


PluginDetect.isMinVersion('Flash', minVersion, instantiate):
[Returns number]
   Returns 1 if plugin is installed (& enabled) and plugin version is >= minVersion.
   Returns 0 if plugin is installed (& enabled). The plugin version is unknown, and thus we are unable to determine if version >= minVersion.
   Returns -0.1 if plugin is installed & enabled, but plugin version is < minVersion.
   Returns -1 if plugin is not installed or not enabled.
   Returns -3 if you supplied a bad input argument to the isMinVersion( ) method.


PluginDetect.getInfo('Flash', instantiate): [object or null]
   Returns null if no information is available for this plugin.
   Returns an object with several useful properties. The properties are listed below. To simplify matters, we assign this object to a variable:
    var INFO = PluginDetect.getInfo('Flash', instantiate);

INFO.precision: [number]
  Reveals the precision of the detected plugin version.
  Returns 0 if the plugin version was not detected.
  Returns 1 if the detected plugin version has the format "Major,0,0,0". The Major version number was detected. The Minor,Revision,Build version numbers could not be detected.
  Returns 2 if the detected plugin version has the format "Major,Minor,0,0". The Major,Minor version numbers were detected. The Revision,Build version numbers could not be detected.
  Returns 3 if the detected plugin version has the format "Major,Minor,Revision,0". The Major,Minor,Revision version numbers were detected. The Build version number could not be detected.
  Returns 4 if the detected plugin version has the format "Major,Minor,Revision,Build". The Major,Minor,Revision,Build version numbers were all detected.

INFO.version: [string or null]
   Returns the version (as a string) of the installed plugin.
   Returns null when the version could not be determined (when plugin is not installed/not enabled, or plugin is installed but the version information is unavailable).

INFO.flashObjUsed: [Boolean]
   Returns true if the Flash player was started during the course of plugin detection. The Flash player was queried by PluginDetect to try to detect the exact plugin version. If a result is obtained by this method, then all 4 digits of the Flash plugin version will usually be revealed. [Note: some browsers may not permit communication between the browser's Javascript and the Flash plugin. Hence the Flash player may not reveal any version information on certain browsers.]
   Returns false otherwise. This means that only passive detection methods were used to detect Flash - such as looking at the browser's navigator arrays.


minVersion: [string or number input argument]
   This is the minimum plugin version.
   Can be a string such as  '1,5,0,0' or '1.5' or '1,5,0,1' or '1.5.0.1' etc...
   Can be a number such as 0 or 1.5 or 1.50 etc...
   If minVersion is not specified, then PluginDetect will assume minVersion is '0'.
   Strings are more versatile than numbers since '1,5,0,1' cannot be expressed as a number.

instantiate: [Boolean. Optional input argument.]
[The instantiate input argument has no effect on Internet Explorer. It only applies to non-Internet Explorer browsers.]
   If instantiate is true, then an instance of the Flash Player will be inserted into the DOM and queried to get the Flash version. [Note: the browser and the Flash plugin must be capable of communication in order for this to work. In some cases, this communication may not be possible.] The advantage to using this feature is that the detection results are more reliable and will get you all 4 digits of the plugin version. The disadvantage is that if the Flash player is very outdated, your browser might show a security popup message asking for permission to run an insecure version of Flash.
   If instantiate is false/undefined, then the Flash Player version will be obtained from the navigator.plugins[ ] array. The detection results will get you 3 or 4 digits of the plugin version, depending on the browser.