chore(webkit): remove url from Connection (#199)
This commit is contained in:
parent
c61c5b056f
commit
c9bc103a00
|
|
@ -30,7 +30,6 @@ export const ConnectionEvents = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export class Connection extends EventEmitter {
|
export class Connection extends EventEmitter {
|
||||||
private _url: string;
|
|
||||||
_lastId = 0;
|
_lastId = 0;
|
||||||
private _callbacks = new Map<number, {resolve:(o: any) => void, reject: (e: Error) => void, error: Error, method: string}>();
|
private _callbacks = new Map<number, {resolve:(o: any) => void, reject: (e: Error) => void, error: Error, method: string}>();
|
||||||
private _delay: number;
|
private _delay: number;
|
||||||
|
|
@ -38,9 +37,8 @@ export class Connection extends EventEmitter {
|
||||||
private _sessions = new Map<string, TargetSession>();
|
private _sessions = new Map<string, TargetSession>();
|
||||||
_closed = false;
|
_closed = false;
|
||||||
|
|
||||||
constructor(url: string, transport: ConnectionTransport, delay: number | undefined = 0) {
|
constructor(transport: ConnectionTransport, delay: number | undefined = 0) {
|
||||||
super();
|
super();
|
||||||
this._url = url;
|
|
||||||
this._delay = delay;
|
this._delay = delay;
|
||||||
|
|
||||||
this._transport = transport;
|
this._transport = transport;
|
||||||
|
|
@ -52,10 +50,6 @@ export class Connection extends EventEmitter {
|
||||||
return session._connection;
|
return session._connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
url(): string {
|
|
||||||
return this._url;
|
|
||||||
}
|
|
||||||
|
|
||||||
send<T extends keyof Protocol.CommandParameters>(
|
send<T extends keyof Protocol.CommandParameters>(
|
||||||
method: T,
|
method: T,
|
||||||
params?: Protocol.CommandParameters[T]
|
params?: Protocol.CommandParameters[T]
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ export class Launcher {
|
||||||
let connection: Connection | null = null;
|
let connection: Connection | null = null;
|
||||||
try {
|
try {
|
||||||
const transport = new PipeTransport(webkitProcess.stdio[3] as NodeJS.WritableStream, webkitProcess.stdio[4] as NodeJS.ReadableStream);
|
const transport = new PipeTransport(webkitProcess.stdio[3] as NodeJS.WritableStream, webkitProcess.stdio[4] as NodeJS.ReadableStream);
|
||||||
connection = new Connection('', transport, slowMo);
|
connection = new Connection(transport, slowMo);
|
||||||
const browser = new Browser(connection, defaultViewport, webkitProcess, gracefullyCloseWebkit);
|
const browser = new Browser(connection, defaultViewport, webkitProcess, gracefullyCloseWebkit);
|
||||||
await browser._waitForTarget(t => t._type === 'page');
|
await browser._waitForTarget(t => t._type === 'page');
|
||||||
return browser;
|
return browser;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue