Skip to content

Commit be6ee8f

Browse files
committed
coding
1 parent e7eb96b commit be6ee8f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/chrome.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Chrome extends EventEmitter {
5656
this.useHostName = !!(options.useHostName);
5757
this.alterPath = options.alterPath || ((path) => path);
5858
this.protocol = options.protocol;
59-
this.local = !!(options.local || options.process);
59+
this.local = !!(options.local);
6060
this.target = options.target || defaultTarget;
6161
this.connectOptions = options.connectOptions;
6262
this.process = options.process;
@@ -121,11 +121,10 @@ class Chrome extends EventEmitter {
121121
try {
122122
if (this.process)
123123
{
124-
const options = {local: this.local, cdp: this};
125124
// we first "connect" to stdio pipes, so that we can
126125
// first the protocol remotely via the pipe.
127126
await this._connect();
128-
const protocol = await this._fetchProtocol(options);
127+
const protocol = await this._fetchProtocol({});
129128
api.prepare(this, protocol);
130129
}
131130
else
@@ -211,6 +210,8 @@ class Chrome extends EventEmitter {
211210
// otherwise user either the local or the remote version
212211
else {
213212
options.local = this.local;
213+
if (this.process)
214+
options.cdp = this;
214215
return await devtools.Protocol(options);
215216
}
216217
}

0 commit comments

Comments
 (0)