зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1391239 - Make AltGr-Enter in the search bar open a new tab. r=adw
*** Fix Bug 1391239. Differential Revision: https://phabricator.services.mozilla.com/D51504 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
bbf2f205ed
Коммит
62a42cd7ca
|
@ -303,7 +303,9 @@
|
|||
} else {
|
||||
let newTabPref = Services.prefs.getBoolPref("browser.search.openintab");
|
||||
if (
|
||||
(aEvent instanceof KeyboardEvent && aEvent.altKey) ^ newTabPref &&
|
||||
(aEvent instanceof KeyboardEvent &&
|
||||
(aEvent.altKey || aEvent.getModifierState("AltGraph"))) ^
|
||||
newTabPref &&
|
||||
!gBrowser.selectedTab.isEmpty
|
||||
) {
|
||||
where = "tab";
|
||||
|
|
|
@ -195,6 +195,20 @@ add_task(async function testAltReturn() {
|
|||
);
|
||||
});
|
||||
|
||||
add_task(async function testAltGrReturn() {
|
||||
await prepareTest();
|
||||
await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
|
||||
EventUtils.synthesizeKey("KEY_Enter", { altGraphKey: true });
|
||||
});
|
||||
|
||||
is(gBrowser.tabs.length, preTabNo + 1, "AltGr+Return key added new tab");
|
||||
is(
|
||||
gBrowser.currentURI.spec,
|
||||
expectedURL(searchBar.value),
|
||||
"testAltGrReturn opened correct search page"
|
||||
);
|
||||
});
|
||||
|
||||
// Shift key has no effect for now, so skip it
|
||||
add_task(async function testShiftAltReturn() {
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче