Skip to content

Conversation

@kongfu-cat
Copy link

What kind of change does this PR introduce?

feature

Did you add tests for your changes?

No, this change only adds a simple getter method that exposes an existing private property.

If relevant, did you update the documentation?

No documentation update needed as this is an internal API addition.

Summary

This PR exposes the internal Connection object in CdpBrowserContext by adding a public getter method. This allows external code to access the underlying CDP connection when working with browser contexts, which can be useful for advanced use cases that need direct access to the connection for sending custom CDP commands or managing sessions.

The change adds a simple get connection(): Connection method that returns the private #connection property, maintaining the existing encapsulation while providing controlled access to the connection object.

Does this PR introduce a breaking change?

No, this is a purely additive change that doesn't modify any existing APIs or behavior.

Other information

This change only modifies packages/puppeteer-core/src/cdp/BrowserContext.ts and adds 4 lines of code to expose the connection getter method.

@google-cla
Copy link

google-cla bot commented Oct 20, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kongfu-cat
Copy link
Author

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

done and success now
image

@github-actions github-actions bot added the Stale label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant