Skip to content

[Bug]: Network mocking does not work for initial request when page opened via extension API chrome.tabs.create() #32865

Open

Description

Version

1.47.2

Steps to reproduce

  1. Clone minimal reproduction repository https://github.com/mdmower/pw-extension-nav
  2. npm install
  3. npx playwright install
  4. npm run test

Expected behavior

I expect the response for network request https://example.com/ to be mocked and test navigation via chrome.tabs.create() to pass. I also expect the console to show Request detected: https://example.com/ during that test.

Actual behavior

The network request to https://example.com/ during test navigation via chrome.tabs.create() is not detected by Playwright.

Additional context

This is a Manifest v3 extension for Chrome and Edge. It uses chrome.tabs.create() to create a tab and navigate to https://example.com/ upon button press.

Enabling (Experimental) Service Worker Network Events does not affect results. The test still fails.

Environment

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
    Memory: 54.68 GB / 62.56 GB
    Container: Yes
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.17.0/bin/yarn
    npm: 10.8.3 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.1.2 - ~/.nvm/versions/node/v20.17.0/bin/pnpm
  IDEs:
    VSCode: 1.93.1 - /usr/bin/code
  Languages:
    Bash: 5.2.15 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.47.2 => 1.47.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions