Skip to content

[Bug]: page event is not fired in non-persistent context for manually opened tabs in Firefox #41184

@fwdekker-pc

Description

@fwdekker-pc

Version

1.60.0

Steps to reproduce

  1. Clone my repo at https://github.com/fwdekker-pc/playwright_python_non_persistent_events_not_fired
  2. Run
    uv sync
  3. Run
    # EITHER
    uv run playwright install firefox
    # OR
    PLAYWRIGHT_SKIP_BROWSER_GC=1 uv run playwright install firefox
    # OR
    $env:PLAYWRIGHT_SKIP_BROWSER_GC=1 ; uv run playwright install firefox
  4. Run
    uv run -m playwright_python_non_persistent_events_not_fired
  5. The console says # Persistent profile. Then a browser window pops up.
  6. Wait until the console says Ready.
  7. Click inside the browser. Manually open a new tab, for example by pressing Ctrl + T, pressing Ctrl + N, or by clicking the new tab icon.
  8. Close the browser window.
  9. The console says # Non-persistent profile. Then another browser window pops up.
  10. Wait until the console says Ready once again.
  11. Click inside the browser. Manually open a new tab, for example by pressing Ctrl + T, pressing Ctrl + N, or by clicking the new tab icon.
  12. Close the browser window.
  13. Stop the script with Ctrl + C.

Expected behavior

After running

context.on("page", lambda: print("Page opened!"))

manually opening a new tab in the browser should print Page opened! to the console.

This should hold for both persistent and non-persistent contexts, and should work in all browsers.

Actual behavior

In Firefox, the Page opened! message is printed only in the persistent context. The page event is apparently not called for manually opened tabs.

In Chromium, the code works as expected.

Additional context

No response

Environment

- Operating System: Windows 11 25H2
- CPU: x64
- Browser: Firefox
- Python Version: 3.14

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions