Name: gm110360 Date: 03/29/2002
FULL PRODUCT VERSION :
java version "1.4.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows NT 4
Service Pack 6
A DESCRIPTION OF THE PROBLEM :
Internet Explorer 5.5 crashes when using Liveconnect with
Plugin 1.4
REGRESSION. Last worked in version 1.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Open the HTML page containing the applet
2.The browser closes as soon as the initialisation is
complete
EXPECTED VERSUS ACTUAL BEHAVIOR :
1. Open the HTML Page
2. The applet starts and makes callbacks to a javascript
function, displaying the results in a textarea
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package browseroverloadapplet;
import java.applet.Applet;
import java.util.Hashtable;
import netscape.javascript.JSObject ;
/**
*
* <p>Title: Browser Overload applet</p>
* <p>Description: </p>
* This applet calls back a Javascript function, passing it a hashtable
* Parameters can be used to set :
* the interval between 2 callbacks
* the number of callbacks to execute
* the name of the javascript function to be called
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class browseroverloadapplet extends Applet {
final static String PARAM_INTERVAL = "interval";
final static String PARAM_TRIES = "tries";
final static String PARAM_CALLBACK = "callback";
final static String PARAM_SUMMARY = "summary";
public void init()
{
}
public void start()
{
try
{
int interval = Integer.parseInt(getParameter(PARAM_INTERVAL));
int tries = Integer.parseInt(getParameter(PARAM_TRIES));
final String key = "key";
StringBuffer value = new StringBuffer("Value:");
Hashtable h = new Hashtable();
Object [] param = new Object[] {h};
JSObject window = JSObject.getWindow(this);
for (int i=0; i<tries; i++)
{
h.put(key, value.append(i));
//Call the Javascript function
window.call(getParameter(PARAM_CALLBACK), param);
value.setLength(6);
if (interval>0)
{
Thread.yield();
//Thread.sleep((long)interval);
}
}
//Call the Javascript Summary function
window.call(getParameter(PARAM_SUMMARY), null);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
/*----------------------
Sample HTML Page
-----------------------*/
<html>
<head>
<title>Browser Overload Applet</title>
<SCRIPT language="Javascript1.2">
var callscount=0;
function test()
{
var hash = test.arguments[0];
document.form1.ta.value+=hash.get("key") + "\n";
callscount++;
}
function summary()
{
document.form1.ta.value+='-------------------------------\n';
document.form1.ta.value+='No of Javascript Calls processed : ' +
callscount;
}
</SCRIPT>
</head>
<body>
<FORM NAME="form1">
<TEXTAREA NAME="ta" ROWS=8 COLS=80>
The results of the callbacks will appear here :
</TEXTAREA>
<INPUT TYPE='TEXT' NAME='tf'/>
</FORM>
<APPLET name="BrowserOverload"
code="browseroverloadapplet.browseroverloadapplet.class"
archive="browseroverload.jar" height="0" width="0" scriptable="true"
mayscript="true">
<param name="interval" value="10"/>
<param name="tries" value="1000"/>
<param name="callback" value="test"/>
<param name="summary" value="summary"/>
</APPLET>
</body>
</html>
---------- END SOURCE ----------
(Review ID: 144658)
======================================================================
- duplicates
-
JDK-4599575 Passing Java Objects to JavaScript crashes the Browser in plug-in 1.4.0 Beta 3.
- Resolved