From 9a808f45ed4acba8c8dc8af4738c582ac417bd49 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 15 Aug 2017 17:32:12 +0900 Subject: implement simple open/tabopen command --- src/content/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/content') diff --git a/src/content/index.js b/src/content/index.js index 8cf0aed..ed33961 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -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: -- cgit v1.2.3