gajus/puppeteer-proxy

Puppeteer bug prevents this library from working with sites that use `request.clone()`

Open

#14 aperta il 28 lug 2020

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (27 fork)github user discovery
bughelp wanted

Metriche repository

Star
 (214 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

As documented here, Puppeteer has a bug where postData isn't available on cloned requests. I realize this is an upstream bug, but if it directly impacts ability to use this library, so I'm documenting it here.

This means that if a website uses popular libraries like KY to send POST requests, you will not be able to use puppeteer-proxy to reconstruct that call. Puppeteer will successfully execute the POST if the request is not intercepted, but it be undefined if intercepted and inspected.

await page.setRequestInterception(true)
page.on('request', async request => {
    // this will log  'undefined' for requests that were created with request.clone() on the page
    logger.info(request.postData())
    request.continue()
    })

Guida contributor