Hi all,
While using the latest version of Mootools I noticed that my Java Applets
werent working. After closer inspection I managed to identify the problem to
a single line within the code the was causing the issue:
this.Document = document.$constructor = new Type('Document', function(){});
This is from line 153 in the
Browser.js<https://github.com/mootools/mootools-core/blob/master/Source/Browser/Browser.js#L153>file.
Strange as it looks but simply including the variable "this.Document =
'string';" wil prevent Java Applets from loading when you have the following
versions of Java installed (Tested with IE 7 and Windows XP):
- JRE 6.0 Update 7
- JRE 6.0 Update 6
- JRE 6.0 Update 5
- JRE 6.0 Update 4
[Due to time constraints JRE 6.0 to JRE 6.0 Update 3 were not tested]
- JRE 5.0 Update 22
[Due to time constraints JRE 5.0 Update 16 to JRE 5.0 Update 21 were not
tested]
- JRE 5.0 Update 15
[Due to time constraints JRE 5.0 Update 1 to JRE 5.0 Update 14 were not
tested]
- JRE 5.0
The following HTML demonstrates this problem when you have any of the above
versions of Java installed:
<html>
<head>
<title>Java Bug</title>
<script type="text/javascript" language="javascript">
this.Document = 'string'; // Remove this line to get it to work
again
</script>
</head>
<body style="background-color:black">
<applet id="testVM" alt="Something is wrong. Java is not working."
codebase="http://www.java.com/applet"
code="testJava2_1/TestVMApplet"
archive="TestVM2-test.jar" width="500" height="280">
<param name="locale" value="en" />
<param name="titleSize" value="22" />
<param name="subtitleSize" value="18" />
<param name="scriptable" value="false">
</applet>
</body>
</html>
In light of the issue would the Mootools team be willing to change the
variable name to something else?
I have also creted an issue about this here:
https://github.com/mootools/mootools-core/issues/84
Thanks