|
|
O'Reilly Network Script Library -- Javascript Plug-in Detection
The script makes it easy to check for the existence of 5 commonly-used plug-ins: Apple's QuickTime, Macromedia's Flash and Shockwave for Director, Real Networks' RealPlayer, and Microsoft's Windows Media Player. The script can also be used to redirect the browser to a new page if a given plug-in is (or is not) found. Finally, the script reports whether detection is or is not possible. Note that for some plug-ins, such as Flash and QuickTime, it is possible to check not only for the plug-in's existence, but for a specific version of the plug-in. However, version information is detected with greater ease and reliability from within a plug-in file. Further, that level of detail would add significantly to the size and complexity of this script. For these reasons, version detection is not included in this script. See the article, Plug-in Detection with JavaScript for a full discussion of this script. This script originally appeared on Apple Internet Developer site. InstructionsCopy the contents of the script between the
To check for a given plug-in, simply call one of the following functions, which return a value of either
For example, to check for the existence of the QuickTime plug-in, you could do the following:
Once you know if the plug-in is installed, there are several things you can do:
Finally, if you simply want to find out if detection is possible at all, do the following:
|
|
|
|
|
||||||||