Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
This commit is contained in:
@@ -276,6 +276,7 @@ export class UrlbarController {
|
||||
* will be deferred by the event bufferer, but preventDefault() and friends
|
||||
* should still happen synchronously.
|
||||
*/
|
||||
// eslint-disable-next-line complexity
|
||||
handleKeyNavigation(event, executeAction = true) {
|
||||
const isMac = AppConstants.platform == "macosx";
|
||||
// Handle readline/emacs-style navigation bindings on Mac.
|
||||
@@ -321,6 +322,12 @@ export class UrlbarController {
|
||||
if (executeAction) {
|
||||
if (this.view.isOpen) {
|
||||
this.view.close();
|
||||
} else if (lazy.UrlbarPrefs.get("focusContentDocumentOnEsc")) {
|
||||
if (this.browserWindow.gBrowser.userTypedValue) {
|
||||
this.input.handleRevert(true);
|
||||
} else {
|
||||
this.browserWindow.gBrowser.selectedBrowser.focus();
|
||||
}
|
||||
} else {
|
||||
this.input.handleRevert({
|
||||
escapeSearchMode: true,
|
||||
|
||||
Reference in New Issue
Block a user