Chrome & Applet may popup an alert box

I got a little problem with Chrome browsers loading a 2.5MB Applets, it popup an alert box saying “this script is blabla, do you want to stop this script” (web page only contain the Applet) then there is two buttons “stop” and “wait”.

if I press “wait” (twice) then Applet start fine.

ideas to remove this alert ? it seems related to Applet size / bandwith, if Applet take too long to load then Chrome popup the alert …

seems more like an issue with the java plugin (or chrome’s implementation), since it shouldn’t be freezing while downloading jars and should provide some response to the browser to let it know its still alive.

Can you give us a link to the page? It doesn’t make sense for the JavaScript long-execution warning to appear for a plugin.

Are you using any special JavaScript-based loaders?

Yes It doesn’t make any sense… but it is here :(, I know that it would have been better to post a link but unfortunatly I can’t yet, I will as soon as it will be possible

not on the current version, the web page is nearly empty and only contain the applet

note : this seems to only happend when bandwith is low

EDIT :

current HTML, nothing really special

<HTML>
	<HEAD>
	<TITLE>Virtual Ocean Races 2 GAME ALPHA - V001 </TITLE>
	<SCRIPT LANGUAGE="JavaScript">
	function setAppletFocus()
	{
		try
		{
			var elem=document.getElementById("AppletVOR");
			elem.focus();
		}
		catch(e)
		{
		}
	}
	</SCRIPT>
	</HEAD>
	<BODY onload="setAppletFocus()" SCROLL="NO" STYLE="background-color:#032B4A;margin:0;BORDER:0;BACKGROUND-REPEAT: repeat;BACKGROUND-IMAGE: url(images/GAME_BACKGROUND.PNG);BACKGROUND-POSITION:center">
		<TABLE cellSpacing=0 cellPadding=0 STYLE="width:100%;height:100%">
			<TR>
				<TD STYLE="text-align:center">
					<APPLET  ID="AppletVOR" archive="client.jar" code="GameApplet" width="960" height="600">
						<PARAM NAME="SESSION_ID" VALUE="1242760653
">
						<PARAM NAME="URI_SERVLET" VALUE="/VOR/VORServer">
						<PARAM name="java_arguments" value="-Xmx90m -Dsun.awt.noerasebackground=true">
						<!-- Use an animated GIF as an indeterminate progress bar while the applet is loading -->
						<PARAM NAME="image" VALUE="images/LOGO_VOR2.PNG">
						<!-- Turn off the box border for better blending with the surrounding web page -->
						<PARAM NAME="boxborder" VALUE="false">
						<!-- Center the loading image -->
						<PARAM NAME="centerimage" VALUE="true">
						<!-- background color -->
						<PARAM name="boxbgcolor" value="#000000">
						<!-- Separated JVM  -->
						<param name="separate_jvm" value="true">
 
					</APPLET>
				</TD>
			</TR>
		</TABLE>
	</BODY>
</HTML>

Aha, you are using JavaScript.

Here:


var elem=document.getElementById("AppletVOR");
elem.focus();

The call to focus() is trying to call directly through the Applet (like LiveConnect). So it will block the JavaScript thread as long as the Applet is loading.

It looks like the DOM onload event fires before the Applet actually loads, which is why that focus call is being done too early.

I will try to remove this one, would be cool if it work did not think the onload may be throw before end of applet load

tk :slight_smile:

hehe that’s working, thanks :slight_smile: