inject: enable domains prior to local CDP

This commit is contained in:
CanadaHonk 2023-04-02 19:20:18 +01:00
parent 09a5cc517e
commit c54e1b5876

View File

@ -78,11 +78,11 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN
let sessionId;
if (injectionType === 'browser') sessionId = await acquireTarget(CDP, target => target.url !== 'about:blank');
if (openingLocal && browserType === 'chromium') await LocalCDP(CDP, { sessionId, url, basePath, csp: localCSP });
await CDP.sendMessage('Runtime.enable', {}, sessionId); // enable runtime API
await CDP.sendMessage('Page.enable', {}, sessionId); // enable page API
if (openingLocal && browserType === 'chromium') await LocalCDP(CDP, { sessionId, url, basePath, csp: localCSP });
CDP.sendMessage('Runtime.addBinding', { // setup sending from window to Node via Binding
name: '_gluonSend'
}, sessionId);