puppeteer: Request event doesn't include websocket requests

Steps to reproduce

Tell us about your environment:

Puppeteer version: 1.6.1 Platform / OS version: Mac OS 10.11.6 URLs (if applicable): about:blank Node.js version: 10.7.0

What steps will reproduce the problem?

var puppeteer = require('puppeteer');

(async () => {
    var browser = await puppeteer.launch(
        {headless:false}
    );
    var page = await browser.newPage();
    await page.setRequestInterception(true);
    page.on('request', req => {
        console.log(req);
        let headers = req.headers;
        headers['origin'] = 'http://www.multiplayerpiano.com';
        req.continue({
            headers: headers
        });
    });
    page.on('console', console.log);
    page.goto(`file://${__dirname}/ppage.html`)

})();

What is the expected result?

Websocket requests should be logged to console and the origin header changed by the interception

What happens instead? I don’t get WebSocket requests logged to console and its origin header is not changed. The “request” event doesn’t emit for WebSocket requests.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 37
  • Comments: 17

Most upvoted comments

Still looking for a solution to this.