send press key to tabs
This commit is contained in:
parent
cf03d278eb
commit
3f8bbe11d9
11 changed files with 153 additions and 30 deletions
29
e2e/ambassador/src/client/keys.js
Normal file
29
e2e/ambassador/src/client/keys.js
Normal 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 };
|
12
e2e/ambassador/src/client/tabs.js
Normal file
12
e2e/ambassador/src/client/tabs.js
Normal 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 };
|
|
@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue