launcher: fix IPC receiving
This commit is contained in:
parent
c7feabb685
commit
11d9a60a79
@ -3,7 +3,7 @@ import IPCApi from '../lib/ipc.js';
|
|||||||
export default async (CDP, injectionType = 'browser', { browserName }) => {
|
export default async (CDP, injectionType = 'browser', { browserName }) => {
|
||||||
let pageLoadCallback = () => {}, onWindowMessage = () => {};
|
let pageLoadCallback = () => {}, onWindowMessage = () => {};
|
||||||
CDP.onMessage(msg => {
|
CDP.onMessage(msg => {
|
||||||
if (msg.method === 'Runtime.bindingCalled' && msg.name === 'gluonSend') onWindowMessage(JSON.parse(msg.payload));
|
if (msg.method === 'Runtime.bindingCalled' && msg.name === '_gluonSend') onWindowMessage(JSON.parse(msg.payload));
|
||||||
if (msg.method === 'Page.frameStoppedLoading') pageLoadCallback(msg.params);
|
if (msg.method === 'Page.frameStoppedLoading') pageLoadCallback(msg.params);
|
||||||
if (msg.method === 'Runtime.executionContextCreated') injectIPC(); // ensure IPC injection again
|
if (msg.method === 'Runtime.executionContextCreated') injectIPC(); // ensure IPC injection again
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user