Skip to content

Bug: [Headful mode] FrameManager throws exceptions when user navigates quickly #2971

@yellowduckling

Description

@yellowduckling

When using PuppeteerSharp in headful mode, the library sometimes throws exceptions internally in FrameManager and related classes (IsolatedWorld, Client_MessageReceived) if the user manually navigates tabs or rapidly changes URLs (e.g., via keyboard shortcuts).

This occurs even if the user code does not trigger any navigation or frame evaluation. The exceptions appear in places like:

await OnFrameNavigatedAsync(response.Frame, response.Type).ConfigureAwait(false);
_logger = Client.Connection.LoggerFactory.CreateLogger();

Steps to reproduce:

  1. Launch a browser in headful mode:
  2. Open a page.
  3. While the page is loaded, manually switch tabs or rapidly change the URL using browser shortcuts.
  4. Observe that PuppeteerSharp throws exceptions internally (e.g., PuppeteerException) even though no user code is calling EvaluateAsync or GoToAsync.

Observed behavior:

Exceptions occur inside internal event handlers, like Client_MessageReceived and IsolatedWorld constructor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions