mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(Browser): introduce browser.process() variable (#1581)
This patch adds a `browser.process()` getter to expose the child process with running browser. Fixes #1539.
This commit is contained in:
@@ -136,7 +136,7 @@ class Launcher {
|
||||
const connectionDelay = options.slowMo || 0;
|
||||
const browserWSEndpoint = await waitForWSEndpoint(chromeProcess, options.timeout || 30 * 1000);
|
||||
connection = await Connection.create(browserWSEndpoint, connectionDelay);
|
||||
return Browser.create(connection, options, killChrome);
|
||||
return Browser.create(connection, options, chromeProcess, killChrome);
|
||||
} catch (e) {
|
||||
forceKillChrome();
|
||||
throw e;
|
||||
@@ -187,7 +187,7 @@ class Launcher {
|
||||
*/
|
||||
static async connect(options = {}) {
|
||||
const connection = await Connection.create(options.browserWSEndpoint);
|
||||
return Browser.create(connection, options, () => connection.send('Browser.close'));
|
||||
return Browser.create(connection, options, null, () => connection.send('Browser.close'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user