How to use the puppeteer/lib/Browser.Browser.Events function in puppeteer

To help you get started, we’ve selected a few puppeteer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github N0taN3rd / Squidwarc / puppeteer-redux / crawler.js View on Github external
async init () {
    this._browser = await puppeteer.launch({
      ignoreDefaultArgs: true,
      args: DEFAULT_ARGS.concat(['--headless']),
      defaultViewport: {width: 1920, height: 1080}
    })
    this._browser.on(Browser.Events.Disconnected, this._onDisconnected)
    this._page = await this._browser.newPage()
    this._client = this._page._client
    await this._init()
    this.requestMonitor = new RequestMonitor()
    this.requestMonitor.attach(this._client)
    this._warcGenerator.on('finished', this._onWARCGenFinished)
    this._warcGenerator.on('error', this._onWARCGenError)
  }