Bug 152278, opening a groupmark shouldn't load about:blank into the active tab. r=blake sr=jag

This commit is contained in:
caillon%returnzero.com 2002-06-18 04:39:43 +00:00
parent 44fc502eda
commit 5990fee38b
2 changed files with 20 additions and 10 deletions

View File

@ -226,6 +226,17 @@ function goHelpMenu( url )
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url ); window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
} }
function getTopWin()
{
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
if (topWindowOfType) {
return topWindowOfType;
}
return null;
}
function openTopWin( url ) function openTopWin( url )
{ {
@ -248,20 +259,14 @@ function openTopWin( url )
url = "about:blank"; url = "about:blank";
} }
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var topWindowOfType = getTopWin();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
if ( topWindowOfType ) if ( topWindowOfType )
{ {
topWindowOfType.focus(); topWindowOfType.focus();
topWindowOfType.loadURI(url); topWindowOfType.loadURI(url);
return topWindowOfType; return topWindowOfType;
} }
else return window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
{
return window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
}
} }
function goAboutDialog() function goAboutDialog()

View File

@ -1872,9 +1872,14 @@
else else
urlValue = "about:blank"; urlValue = "about:blank";
w = openTopWin(urlValue); if (groupTarget) {
if (groupTarget) w = getTopWin();
w.focus();
w.OpenBookmarkGroupFromResource(this.currentRes, this.db, this.rdf); w.OpenBookmarkGroupFromResource(this.currentRes, this.db, this.rdf);
}
else {
openTopWin(urlValue);
}
} }
if (aEvent) if (aEvent)
aEvent.preventBubble(); aEvent.preventBubble();