broadcast an action
This commit is contained in:
parent
3d35db9fc1
commit
0eed357a5e
4 changed files with 15 additions and 11 deletions
|
@ -11,19 +11,16 @@ let vvConsole = new ConsoleFrame(window);
|
|||
browser.runtime.onMessage.addListener((action) => {
|
||||
switch (action.type) {
|
||||
case actions.CMD_OPEN:
|
||||
vvConsole.showCommand('');
|
||||
break;
|
||||
return vvConsole.showCommand('');
|
||||
case actions.CMD_TABS_OPEN:
|
||||
if (action.alter) {
|
||||
// alter url
|
||||
vvConsole.showCommand('open ' + window.location.href);
|
||||
return vvConsole.showCommand('open ' + window.location.href);
|
||||
} else {
|
||||
vvConsole.showCommand('open ');
|
||||
return vvConsole.showCommand('open ');
|
||||
}
|
||||
break;
|
||||
case actions.CMD_BUFFER:
|
||||
vvConsole.showCommand('buffer ');
|
||||
break;
|
||||
return vvConsole.showCommand('buffer ');
|
||||
case actions.SCROLL_LINES:
|
||||
scrolls.scrollLines(window, action.count);
|
||||
break;
|
||||
|
|
Reference in a new issue