Is there a way to intercept and mock WebSockets requests/responses with puppeteer?
page.on('request', request => {
console.log('Intercepting Request ', request, { depth: null });
request.continue();
});
page.on('response', response => {
console.log('Intercepting Response ', response, { depth: null });
response.abort();
});
does not show the requests/responses made through WebSocket.
This How to use puppeteer to dump WebSocket data is answering the question somewhat, but not by using puppeteer
but by using ws
.