Bug 1041678 - CTRL/Command K should goto search bar in new tab if open, rather than opening about:home. r=Gijs, r=adw

This commit is contained in:
Alex Bardas
2014-08-14 15:48:00 -04:00
parent 55075f0bfa
commit 440f73e7a4
8 changed files with 78 additions and 1 deletions

View File

@@ -106,6 +106,9 @@ let AboutHomeListener = {
case "AboutHome:Update":
this.onUpdate(aMessage.data);
break;
case "AboutHome:FocusInput":
this.onFocusInput();
break;
}
},
@@ -138,6 +141,7 @@ let AboutHomeListener = {
doc.documentElement.setAttribute("hasBrowserHandlers", "true");
let self = this;
addMessageListener("AboutHome:Update", self);
addMessageListener("AboutHome:FocusInput", self);
addEventListener("click", this.onClick, true);
addEventListener("pagehide", function onPageHide(event) {
if (event.target.defaultView.frameElement)
@@ -212,6 +216,10 @@ let AboutHomeListener = {
break;
}
},
onFocusInput: function () {
content.document.getElementById("searchText").focus();
},
};
AboutHomeListener.init(this);