implement simple open/tabopen command

This commit is contained in:
Shin'ya Ueoka 2017-08-15 17:32:12 +09:00
parent f66b7a1c21
commit 9a808f45ed
3 changed files with 53 additions and 18 deletions

View file

@ -12,7 +12,20 @@ const invokeEvent = (action) => {
switch (action[0]) {
case actions.CMD_OPEN:
footer = new FooterLine(document);
footer.input.value = ':';
footer.onPromptChange((e) => {
let request = {
type: 'event.cmd.suggest',
text: e.target.value
};
browser.runtime.sendMessage(request);
});
footer.onEntered((e) => {
let request = {
type: 'event.cmd.enter',
text: e.target.value
};
browser.runtime.sendMessage(request);
});
footer.focus();
break;
case actions.SCROLL_UP: