зеркало из https://github.com/mozilla/gecko-dev.git
Make new tabs _not_ open for just enter if the "open new tab for
ctrl-enter" pref is set. Bug 105537, r=timeless, sr=hyatt
This commit is contained in:
Родитель
458baf3bf3
Коммит
ff5fd892ff
|
@ -908,13 +908,16 @@ function loadURI(uri, referrer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BrowserLoadURL()
|
function BrowserLoadURL(aTriggeringEvent)
|
||||||
{
|
{
|
||||||
var url = gURLBar.value;
|
var url = gURLBar.value;
|
||||||
if (url.match(/^view-source:/)) {
|
if (url.match(/^view-source:/)) {
|
||||||
BrowserViewSourceOfURL(url.replace(/^view-source:/, ""), null);
|
BrowserViewSourceOfURL(url.replace(/^view-source:/, ""), null);
|
||||||
} else {
|
} else {
|
||||||
if (pref && pref.getBoolPref("browser.tabs.opentabfor.urlbar") && getBrowser().localName == "tabbrowser") {
|
if (pref && pref.getBoolPref("browser.tabs.opentabfor.urlbar") &&
|
||||||
|
getBrowser().localName == "tabbrowser" &&
|
||||||
|
aTriggeringEvent && 'ctrlKey' in aTriggeringEvent &&
|
||||||
|
aTriggeringEvent.ctrlKey) {
|
||||||
var t = getBrowser().addTab(getShortcutOrURI(url)); // open link in new tab
|
var t = getBrowser().addTab(getShortcutOrURI(url)); // open link in new tab
|
||||||
getBrowser().selectedTab = t;
|
getBrowser().selectedTab = t;
|
||||||
}
|
}
|
||||||
|
@ -1454,10 +1457,10 @@ function handleURLBarRevert()
|
||||||
return isScrolling;
|
return isScrolling;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleURLBarCommand(aUserAction)
|
function handleURLBarCommand(aUserAction, aTriggeringEvent)
|
||||||
{
|
{
|
||||||
addToUrlbarHistory();
|
addToUrlbarHistory();
|
||||||
BrowserLoadURL();
|
BrowserLoadURL(aTriggeringEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdatePageProxyState()
|
function UpdatePageProxyState()
|
||||||
|
|
|
@ -163,7 +163,7 @@ Contributor(s): ______________________________________. -->
|
||||||
showCommentColumn="true"
|
showCommentColumn="true"
|
||||||
tooltiptext="&locationBar.tooltip;"
|
tooltiptext="&locationBar.tooltip;"
|
||||||
oninput="window.XULBrowserWindow.userTyped.value=true;"
|
oninput="window.XULBrowserWindow.userTyped.value=true;"
|
||||||
ontextcommand="return handleURLBarCommand(eventParam);"
|
ontextcommand="return handleURLBarCommand(eventParam, domEvent);"
|
||||||
ontextrevert="return handleURLBarRevert();"
|
ontextrevert="return handleURLBarRevert();"
|
||||||
onfocus="URLBarFocusHandler(event);"
|
onfocus="URLBarFocusHandler(event);"
|
||||||
onblur="URLBarBlurHandler(event);">
|
onblur="URLBarBlurHandler(event);">
|
||||||
|
|
Загрузка…
Ссылка в новой задаче