Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: page 'request' event doesn't capture network traffic from a Shared Worker #33917

Open
bretticus-mc opened this issue Dec 9, 2024 · 1 comment

Comments

@bretticus-mc
Copy link

Version

1.48.2

Steps to reproduce

Page.on('request') captures network requests from a tab but not from a Shared Worker. This is unexpected. It would greatly enhance our troubleshooting of test failures if we could capture the requests from a shared worker. Tested in Chrome and Firefox.

Sample code:

const { chromium } = require('playwright');

(async () => {
  // Launch browser
  const browser = await chromium.launch({ headless: false });

  // Create a new context and page
  const context = await browser.newContext();
  const page = await context.newPage();

  // Log all network requests
  page.on('request', (request) => {
    console.log(`Request: ${request.method()} ${request.url()}`);
  });

  // Log responses
  page.on('response', (response) => {
    console.log(`Response: ${response.status()} ${response.url()}`);
  });

  // Navigate to the desired page
  await page.goto('https://example.com');

  await browser.close();
})();

Expected behavior

I expect all network traffic in Chromium to be captured by the page's 'request' event.

Actual behavior

Only network requests from the tab are captured.

Additional context

No response

Environment

System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 99.83 MB / 32.00 GB
  Binaries:
    Node: 18.18.0 - /opt/homebrew/opt/node@18/bin/node
    npm: 9.8.1 - /opt/homebrew/opt/node@18/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.48.2 => 1.48.2
@yury-s
Copy link
Member

yury-s commented Dec 10, 2024

This was filed before as #17197 and #7107 but didn't get enough upvotes. I'll keep this report open to gauge the interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants