JavaFx web not working with Internet Explorer 11 with JRE7

99封情书 提交于 2019-12-01 21:36:51
jewelsea

Internet Explorer 11 is not a supported configuration for JavaFX in JRE 7.

You can request support for Internet Explorer 11 by filing a feature request in the JavaFX issue tracker. You can link back to this question in your feature request.

I guess what you are saying in your question is that the information Microsoft place in the UserAgent string for IE11 has changed from previous versions and the way to understand the UserAgent string encoded information has changed in IE11 compared to earlier browser releases. These changes mean that the current JavaFX deployment code does not correctly detect it is running in an IE11 environment and perform appropriate operations to enable JavaFX applications to execute in IE11.

I believe that JavaFX packaging code uses a dtjava.js script to detect the target browser. For JavaFX 8 this detection routine is (I believe) the JavaScript detectEnv() method. What you might need to do to get IE11 compatibility is to host your own deployment scripts and replace the dtjava.js in your local deployment scripts with a modified version you have created which is IE 11 compatible (detailed instructions on how to do this are outside the scope of this answer). Even if you do get the dtjava.js script to correctly identify and execute logic for IE 11, there may still be other issues running JavaFX in IE 11 (due to it not being currently a supported deployment platform).

I've made some modifications in dtjava.js and got it to work in IE11

In my case I'm using dtjava.js only for embedding an applet not based in JavaFX, so probably these modifications are not enough to make a JavaFX application run.

I changed the IE detection rule from

ie = isDef(window.execScript);

to

ie = /trident/.test(u);

in detectEnv()

and

if (isDef(d.addEventListener)) {
    d.addEventListener("DOMContentLoaded",
    invokeCallbacks, false);
}
if (ua.ie && ua.win) {

with

if (isDef(d.addEventListener)) {
    d.addEventListener("DOMContentLoaded",
    invokeCallbacks, false);
}
else if (isDef(d.attachEvent)) {

in init() function.

Of course, these are hacky changes not very tested (only Explorer 10, 11 and latest FIrefox and Chrome). Follow at your own risk...

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