I have the same problem. I would expect that the window opened would get focus once loaded. I also expect the parent would regain focus on the close of the child. I have tried using focus() function to force focus on
tags or window objects(fruitless). I am guessing focus() will work on <input> tags, thus causing bubbling bring the window into focus as well. Only a guess! I have not tried it.
Main page:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script language="javascript" type="text/javascript" src="kb1.js"></script>
</head>
<body>
First Anchor tabindex 1
Second Anchor tabindex 2
On the return after closing the popup window this window does not get focus unless you click
somewhere on the page.
</body>
</html>
Link to page:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script language="javascript" type="text/javascript" src="kb1.js"></script>
</head>
<body>
Click to close
Will not open itself, which is a good thing
Notice that this window does not get keyboard focus unless you click
somewhere other than the first anchor. The onkeydown function is not active.
</body>
</html>
Script to open window via keyboard:
<!--
/* This code is for Safari: onkeypress does not fire for nav keys*/
document.documentElement.onkeydown = function(e) {
var iKeyCode = getKeyCode(e);
if (iKeyCode != 13) {return true};
var strFeatures =
",resizable=yes,scrollbars=yes,status=yes" +
",toolbar=no,menubar=no,location=no";
window.open("SAFto.html","SAFto",strFeatures);
};
function getKeyCode(e) {
var code = null;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
//alert('Key Code: ' + code);
return code;
};
-->