简体   繁体   中英

Distinguish if JAVA is disabled or not installed using Javascript

How can I distinguish between the following scenarios using a Javascript test in browser?

  1. Java is installed but disabled
  2. Java is not installed at all

I have checked deployJava.js and navigator.javaEnabled() but they seem to return false in both scenarios if I disable JAVA using JAVA control panel in Windows.

deployJava.versionCheck("1.5+") //false

navigator.javaEnabled() //false

Thanks for your help.

PS I checked similar answers but they all are related to detecting to some other version of JAVA. I just need to know which of the above mentioned state occurs.

From the browser, there's no way to differentiate between the two cases you mention. When you disable java using the control panel, then it doesn't get loaded into the browser, and so the browser cannot tell you if it's installed or not.

You would have a similar issue with other plugins if they had an on-off switch of that form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM