diff --git a/docs/api.md b/docs/api.md index 610cd891..ee85e3d7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -260,6 +260,7 @@ puppeteer.launch().then(async browser => { - `options` <[Object]> - `browserWSEndpoint` <[string]> a [browser websocket endpoint](#browserwsendpoint) to connect to. - `ignoreHTTPSErrors` <[boolean]> Whether to ignore HTTPS errors during navigation. Defaults to `false`. + - `slowMo` <[number]> Slows down Puppeteer operations by the specified amount of milliseconds. Useful so that you can see what is going on. - returns: <[Promise]<[Browser]>> This methods attaches Puppeteer to an existing Chromium instance. diff --git a/lib/Launcher.js b/lib/Launcher.js index 7afd8d72..ccd53293 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -196,7 +196,8 @@ class Launcher { * @return {!Promise} */ 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')); } }