deployJava.js not detecting JRE in IE 11

泄露秘密 提交于 2019-12-04 04:32:42

After some digging it appears that this is due to Microsoft changing the user agent that Internet Explorer 11 reports (see here). The "deployJava.js" library has it's own browser detection function (getBrowser()) and it does not handle the user agent for IE11 correctly.

The following bug reports from OpenJDK talk about this issue:

I tried the "official" version of deployJava.js (here) and it has not been updated with a fix yet. The suggested work-around is to modify the "getBrowser" method to look for "trident" in addition to "MSIE". If you don't want to wait for Oracle to make the update you could just create your own local copy of deployJava.js and replace:

(o.indexOf("msie")!=-1)

with

((o.indexOf("msie")!=-1)||(o.indexOf("trident")!=-1))

Oracle already fix this issue as mentioned by Mr. T in their latest deployJava.js.
But I still encounter error ,I was still being redirected to http://java.com/en/download/ie_manual.jsp

Although I installed latest JRE in my IE11. After digging into deployJava.js, turns out in function testUsingActiveX()

if (typeof ActiveXObject == "undefined" || !ActiveXObject) {
   g("[testUsingActiveX()] Browser claims to be IE, but no ActiveXObject object?");
   return false
}

I modifed the above function to below

if("ActiveXObject" in window)
{
  //do nothing
}
else if (typeof ActiveXObject == "undefined" || !ActiveXObject) {
   g("[testUsingActiveX()] Browser claims to be IE, but no ActiveXObject object?");
   return false
}

Solution above credit to SebLD

Although not a great solution, unsetting the compatibility view in IE solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!