ipc: no longer require own load promise

This commit is contained in:
CanadaHonk 2023-02-08 19:03:45 +00:00
parent 5a965bf40a
commit c6c5cc935d
2 changed files with 1 additions and 3 deletions

View File

@ -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;

View File

@ -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,