diff --git a/src/popup/interface.js b/src/popup/interface.js index b8c4c6f..8fd8542 100644 --- a/src/popup/interface.js +++ b/src/popup/interface.js @@ -218,5 +218,20 @@ function keyHandler(e) { this.doAction(e.shiftKey ? "launchInNewTab" : "launch"); } break; + case "Home": { + document.querySelector(".part.search input[type=text]").focus(); + document.querySelector(".logins").scrollTo(0, 0); + window.scrollTo(0, 0); + break; + } + case "End": { + let logins = document.querySelectorAll(".login"); + if (logins.length) { + let target = logins.item(logins.length - 1); + target.focus(); + target.scrollIntoView(); + } + break; + } } } diff --git a/src/popup/searchinterface.js b/src/popup/searchinterface.js index 96d89fa..078876b 100644 --- a/src/popup/searchinterface.js +++ b/src/popup/searchinterface.js @@ -114,6 +114,17 @@ function view(ctl, params) { ); } break; + case "End": { + if (e.target.selectionStart === e.target.value.length) { + let logins = document.querySelectorAll(".login"); + if (logins.length) { + let target = logins.item(logins.length - 1); + target.focus(); + target.scrollIntoView(); + } + } + break; + } } } })