From 6261cfb8c4f643c420ecc9e99d2b90e9e3f1f96f Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Thu, 14 Sep 2006 06:03:57 +0000 Subject: [PATCH] Bug 37638: URL bar is given focus by default in new window [via accel+N or File > New Navigator Window] Bug 89835: Window opened up with JavaScript has focus in the URL bar while NN4 and IE put focus on the content area Focus will now always go to the content area unless we're opening for a blank page. r=bryner, sr=hewitt --- suite/browser/navigator.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js index 3f1890262f7..d3a9f5e879c 100644 --- a/suite/browser/navigator.js +++ b/suite/browser/navigator.js @@ -410,8 +410,8 @@ function Startup() if (uriToLoad && uriToLoad != "about:blank") { gURLBar.value = uriToLoad; - if ("arguments" in window && window.arguments.length >= 4) { - loadURI(uriToLoad, window.arguments[3]); + if ("arguments" in window && window.arguments.length >= 3) { + loadURI(uriToLoad, window.arguments[2]); } else { loadURI(uriToLoad); } @@ -428,12 +428,11 @@ function Startup() return; } - // Focus the content area if the caller instructed us to. - if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true || - !window.locationbar.visible) - setTimeout(WindowFocusTimerCallback, 0, _content); - else + // Focus the content area unless we're loading a blank page + if (uriToLoad == "about:blank" && window.locationbar.visible) setTimeout(WindowFocusTimerCallback, 0, gURLBar); + else + setTimeout(WindowFocusTimerCallback, 0, _content); // Perform default browser checking (after window opens). setTimeout( checkForDefaultBrowser, 0 );