Mozilla 1.6 (linux) has javascript window.focus() bug?

S

Scott Navarre

Hello,

I have the latest Mozilla 1.6 (the 1.6 installer downloaded from
mozilla.org) installed on a standard "Everything" installed RedHat 8.0 linux
system. Given the following simple page code:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var newWindow=null;
function makeNewWindow()
{
if (!newWindow || newWindow.closed)
{
newWindow=window.open("","","width=250,height=250");
newWindow.document.write('This is a new window!');
newWindow.document.close();
}
else
newWindow.focus();
}
</SCRIPT>
</HEAD>
<BODY onUnload="if (newWindow && !newWindow.closed) newWindow.close()">
<FORM>
<CENTER><INPUT TYPE="BUTTON" NAME="NewWin" VALUE="Open New Window"
onClick="makeNewWindow()"></CENTER>
</FORM>
</BODY>
</HTML>

when one clicks the button, a new window opens up. And then if you click
back on the main window, the main window comes to front causing the new
window to hide behind. Finally if you click the button on the main page
again, rather than open a new window again it brings the already open window
back to the front -- using focus().
The problem is that when the new window is brought back to the front, it
gets displayed in front of the main window as expected BUT it is not
active -- the bar on top of the window is grayed while the main window's bar
is still active (not grayed). You actually then have to click inside the
new window to get it active. This seems to be a bug! I think this worked
properly in the default Mozilla 1.0.1 that came with RedHat 8.0...

So is this a bug, or am I doing something wrong??? Does anyone know which
latest "final" version of Mozilla (for linux) handles this properly?

Thanks in advance,
Scott Navarre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top