feat: add slowMo option to puppeteer.connect (#1864)

This patch introduces a `slowMo` option to the `puppeteer.connect` method. The option
is similar to the one in `puppeteer.launch` and is used to slow down the connection.
This commit is contained in:
Abel Toledano
2018-01-23 01:45:46 +01:00
committed by Andrey Lushnikov
parent 797b561013
commit b61e67d001
2 changed files with 3 additions and 1 deletions

View File

@@ -196,7 +196,8 @@ class Launcher {
* @return {!Promise<!Browser>}
*/
static async connect(options = {}) {
const connection = await Connection.create(options.browserWSEndpoint);
const connectionDelay = options.slowMo || 0;
const connection = await Connection.create(options.browserWSEndpoint, connectionDelay);
return Browser.create(connection, options, null, () => connection.send('Browser.close'));
}
}