puppeteer-sharp icon indicating copy to clipboard operation
puppeteer-sharp copied to clipboard

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

Open yellowduckling opened this issue 1 month ago • 2 comments

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<IsolatedWorld>();

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.

yellowduckling avatar Oct 16 '25 17:10 yellowduckling