Puppeteer: 'Network.setRequestInterceptionEnabled' wasn't found undefined

Created on 23 Oct 2017  路  1Comment  路  Source: puppeteer/puppeteer

Hi there,

Network.setRequestInterceptionEnabled is removed in Chrome DevTools Protocol

I'm tested in HeadlessChrome/64.0.3248.0

Please update puppeteer for new CDP, Thanks.

How to fix?

  • Edit puppeteer/lib/NetworkManager.js
  • Change Network.setRequestInterceptionEnabled to Network.setRequestInterception
async _updateProtocolRequestInterception() {
    const enabled = this._userRequestInterceptionEnabled || !!this._credentials;
    if (enabled === this._protocolRequestInterceptionEnabled) return;
    this._protocolRequestInterceptionEnabled = enabled;
    await this._client.send("Network.setRequestInterception", {
        patterns: [{ urlPattern: '*' }]
    });
}

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings