зеркало из https://github.com/mozilla/pjs.git
Bug 429926 - Make Cmd+T open a new window when no browser windows are open. r=jag, sr=Neil.
This commit is contained in:
Родитель
b33de73d9d
Коммит
61ce561951
|
@ -1273,13 +1273,22 @@ function BrowserOpenTab()
|
|||
Components.interfaces.nsIPrefLocalizedString).data;
|
||||
break;
|
||||
case 2:
|
||||
uriToLoad = getWebNavigation().currentURI.spec;
|
||||
uriToLoad = gBrowser ? getWebNavigation().currentURI.spec
|
||||
: Components.classes["@mozilla.org/browser/global-history;2"]
|
||||
.getService(Components.interfaces.nsIBrowserHistory)
|
||||
.lastPageVisited;
|
||||
break;
|
||||
}
|
||||
} catch(e) {
|
||||
uriToLoad = "about:blank";
|
||||
}
|
||||
|
||||
// Open a new window if someone requests a new tab when no browser window is open
|
||||
if (!gBrowser) {
|
||||
openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", uriToLoad);
|
||||
return;
|
||||
}
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab(uriToLoad);
|
||||
var navBar = document.getElementById("nav-bar");
|
||||
if (uriToLoad == "about:blank" && !navBar.hidden && window.locationbar.visible)
|
||||
|
@ -1713,7 +1722,7 @@ function hiddenWindowStartup()
|
|||
window.focus();
|
||||
|
||||
// Disable menus which are not appropriate
|
||||
var disabledItems = ['cmd_newNavigatorTab', 'cmd_close', 'Browser:SendPage',
|
||||
var disabledItems = ['cmd_close', 'Browser:SendPage',
|
||||
'Browser:EditPage', 'Browser:SavePage', 'cmd_printSetup',
|
||||
'Browser:Print', 'canGoBack', 'canGoForward',
|
||||
'Browser:AddBookmark', 'Browser:AddBookmarkAs',
|
||||
|
|
Загрузка…
Ссылка в новой задаче