ipc: no longer require own load promise
This commit is contained in:
parent
5a965bf40a
commit
c6c5cc935d
@ -109,7 +109,6 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN
|
||||
browserType
|
||||
}, {
|
||||
evalInWindow,
|
||||
frameLoadPromise,
|
||||
evalOnNewDocument: source => CDP.sendMessage('Page.addScriptToEvaluateOnNewDocument', { source }, sessionId)
|
||||
});
|
||||
onWindowMessage = ipcMessageCallback;
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default ({ browserName, browserInfo, browserType }, { evalInWindow, evalOnNewDocument, pageLoadPromise }) => {
|
||||
export default ({ browserName, browserInfo, browserType }, { evalInWindow, evalOnNewDocument }) => {
|
||||
const injection = `(() => {
|
||||
if (window.Gluon) return;
|
||||
let onIPCReply = {}, ipcListeners = {};
|
||||
@ -133,7 +133,6 @@ delete window._gluonSend;
|
||||
const isReply = !!id;
|
||||
id = id ?? Math.random().toString().split('.')[1];
|
||||
|
||||
await pageLoadPromise; // wait for page to load before sending, otherwise messages won't be heard
|
||||
evalInWindow(`window.Gluon.ipc._receive(${JSON.stringify({
|
||||
id,
|
||||
type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user