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

[2493 byte] By [Eric11a] at [2007-11-27 5:50:43]
# 1

I am not sure if it helps or not because I imagine you are already aware of this as a potential workaround, but we are running into the same issues where we need to know what version of the JRE plugin is on the client's machine.

We are looking into Family Versioning to ensure that our applets are being run on 1.5 and no other plugin.

[url]http://java.sun.com/j2se/1.5.0/family-clsid.html[/url]

Unfortunately I can't really help you because I haven't gotten an upgrade to IE7 just yet as it seems to being throwing some strange pop-up messages with other people who are implementing family versioning.

maple_shafta at 2007-7-12 15:38:39 > top of Java-index,Desktop,Deploying...
# 2
On My WinXP SP2 machine with IE 7, I also get popups with family versioning. The reason for this is that the classid for family versioning is not a pre-approved ActiveX control (at least not on WinXP) for IE 7.
Eric11a at 2007-7-12 15:38:39 > top of Java-index,Desktop,Deploying...
# 3

> I am not sure if it helps or not because I imagine

> you are already aware of this as a potential

> workaround, but we are running into the same issues

> where we need to know what version of the JRE plugin

> is on the client's machine.

>

> We are looking into Family Versioning to ensure that

> our applets are being run on 1.5 and no other

> plugin.

>

> [url]http://java.sun.com/j2se/1.5.0/family-clsid.html[

> /url]

>

> Unfortunately I can't really help you because I

> haven't gotten an upgrade to IE7 just yet as it seems

> to being throwing some strange pop-up messages with

> other people who are implementing family versioning.

Sorry to bump this thread, but I did say something technically incorrect in this previous post.

IE7 is not responsible for the pop-up message asking if the user wants to download a correct plugin to match the family versioning of the applet.

This is actually caused by JRE version 6.

maple_shafta at 2007-7-12 15:38:39 > top of Java-index,Desktop,Deploying...
# 4
I forgot to mention that my Java detection technique does not require the use of any class file. It only uses Javascript.
Eric11a at 2007-7-12 15:38:40 > top of Java-index,Desktop,Deploying...