Testing Java Plugin Detection for IE 7
The standard technique for detecting the jre version is to embed a small java applet in your web page, and then you query the applet to get the jre version/vendor. This has worked for both Internet Explorer and other browsers.
The only problem I have with this approach is that you have to wait some random amount of time until the applet fully initializes/runs to give you an answer. Usually, this means waiting for window.onload to fire, or querying the applet every 100ms until you get a response. Or, you have the applet run some javascript function once the applet is ready to do so.
What I want instead is a simple to use javascript that says:
version = getVersion('Java')
The getVersion() routine runs, and when it is done it returns the installed Java version. You don't have to wait some arbitrary length of time after the getVersion()
routine has run in order to know the answer.
Since Internet Explorer 7 came out, I have been trying to do precisely this.
And, I have been trying to find a way to avoid causing IE 7 to give any security popups when doing plugin detection (ie. the yellow info bar that pops up from time to time).
What I have learned is that only a very few ActiveX controls are pre-approved by Microsoft. If a control has not been pre-approved, then there is no way to be sure in your detection script whether that control will actually work or not.
With that in mind, I believe I may have devised a somewhat unique method of plugin detection (using only javascript, no external java applets or .class files or .jar files) for Internet Explorer that deals with all these issues.
Since this is all justexperimental, I would like some feedback on a javascript I wrote that tries to detect Sun Java (among others). The link is here:
http://www.pinlady.net/test/PluginDetect.htm
Please note that I am not 100% certain as to whether this detection script will work for everyone. It works for me, on Win XP SP2/ IE 7. But I would like some feedback from others nonetheless.
And if you are in a really good mood, it would be helpful to me if you posted the contents of a Windows Registry key for me from your Windows XP/Vista/IE 7 system. The key is:
HKEY_LOCAL_Machine\Software\Microsoft\Windows\CurrentVersion\Ext\PreApproved
The contents of this key will help me to avoid causing any security popup messages in IE 7.
Thanks for your patience,
Eric

