Skip to content

Conversation

kblok
Copy link
Member

@kblok kblok commented Oct 20, 2025

No description provided.

@kblok kblok requested a review from Copilot October 20, 2025 19:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements frame detachment detection for the WebDriver BiDi protocol by adding support for checking whether frames have been closed/detached. The changes enable proper error handling when attempting to evaluate JavaScript in detached frames.

Key Changes:

  • Added Detached property support for BiDi frames linked to the browsing context's closed state
  • Implemented detachment checks in the evaluation pipeline to throw appropriate errors
  • Removed test expectations for now-passing frame, fixture, crash, device-request-prompt, diffstyle, and drag-and-drop test suites

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/PuppeteerSharp/Frame.cs Made Detached property virtual to allow BiDi override
lib/PuppeteerSharp/Bidi/Core/BrowsingContext.cs Added IsClosed property to track browsing context closure state
lib/PuppeteerSharp/Bidi/BidiRealm.cs Added virtual ThrowIfDetached() method and its invocation in evaluation pipeline
lib/PuppeteerSharp/Bidi/BidiFrameRealm.cs Implemented detachment check that throws exception for detached frames
lib/PuppeteerSharp/Bidi/BidiFrame.cs Overrode Detached property to return browsing context closure state
lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json Removed failing test expectations for multiple test suites now passing with BiDi implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

kblok added 6 commits October 20, 2025 16:18
# Conflicts:
#	lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json
#	lib/PuppeteerSharp.Tests/ElementHandleTests/ContentFrameTests.cs
@kblok kblok merged commit c4a9fa4 into v21 Oct 21, 2025
18 of 19 checks passed
@kblok kblok deleted the bidi-frame-spec branch October 21, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant