Skip to content

Commit

Permalink
feat(page): mark page.client() as internal (#7585)
Browse files Browse the repository at this point in the history
This PR marks the .client() method as internal since
we don't encourage our users to use it.
  • Loading branch information
OrKoN committed Sep 21, 2021
1 parent 99ca842 commit 8451951
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/api.md
Expand Up @@ -133,7 +133,6 @@
* [page.browser()](#pagebrowser)
* [page.browserContext()](#pagebrowsercontext)
* [page.click(selector[, options])](#pageclickselector-options)
* [page.client()](#pageclient)
* [page.close([options])](#pagecloseoptions)
* [page.content()](#pagecontent)
* [page.cookies([...urls])](#pagecookiesurls)
Expand Down Expand Up @@ -1466,12 +1465,6 @@ const [response] = await Promise.all([

Shortcut for [page.mainFrame().click(selector[, options])](#frameclickselector-options).

#### page.client()

- returns: <[CDPSession]>

Get the CDP session client the page belongs to.

#### page.close([options])

- `options` <[Object]>
Expand Down
1 change: 1 addition & 0 deletions src/common/Page.ts
Expand Up @@ -731,6 +731,7 @@ export class Page extends EventEmitter {

/**
* Get the CDP session client the page belongs to.
* @internal
*/
client(): CDPSession {
return this._client;
Expand Down
1 change: 1 addition & 0 deletions utils/doclint/check_public_api/index.js
Expand Up @@ -25,6 +25,7 @@ const {
const EXCLUDE_PROPERTIES = new Set([
'Browser.create',
'Headers.fromPayload',
'Page.client',
'Page.create',
'JSHandle.toString',
'TimeoutError.name',
Expand Down

1 comment on commit 8451951

@leumasme
Copy link

Choose a reason for hiding this comment

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

Disagree. There are various valid use cases for this and i dont see why you added a getter function for the internal _client property which has the sole purpose of making it public just to then make that getter function internal. Seems like nonsense to me.

Please sign in to comment.