send press key to tabs

This commit is contained in:
Shin'ya Ueoka 2018-02-11 15:40:34 +09:00
parent cf03d278eb
commit 3f8bbe11d9
11 changed files with 153 additions and 30 deletions

View file

@ -0,0 +1,29 @@
import { EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP } from '../shared/messages';
import * as ipc from './ipc';
const press = (tabId, key) => {
return ipc.send({
type: EVENT_KEYPRESS,
tabId,
key,
});
};
const down = (tabId, key) => {
return ipc.send({
type: EVENT_KEYDOWN,
tabId,
key,
});
};
const up = (tabId, key) => {
return ipc.send({
type: EVENT_KEYUP,
tabId,
key,
});
};
export { press, down, up };

View file

@ -0,0 +1,12 @@
import { TABS_CREATE } from '../shared/messages';
import * as ipc from './ipc';
const create = (windowId, url) => {
return ipc.send({
type: TABS_CREATE,
windowId,
url,
});
};
export { create };

View file

@ -1,9 +1,10 @@
import { WINDOWS_CREATE, WINDOWS_REMOVE } from '../shared/messages';
import * as ipc from './ipc';
const create = () => {
const create = (url) => {
return ipc.send({
type: WINDOWS_CREATE
type: WINDOWS_CREATE,
url,
});
};