Skip to content

Commit

Permalink
feat: export Frame._client through getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Feb 21, 2022
1 parent 131924f commit 13e772d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/api.md
Expand Up @@ -267,6 +267,7 @@
* [frame.addStyleTag(options)](#frameaddstyletagoptions)
* [frame.childFrames()](#framechildframes)
* [frame.click(selector[, options])](#frameclickselector-options)
* [frame.client()](#frameclient)
* [frame.content()](#framecontent)
* [frame.evaluate(pageFunction[, ...args])](#frameevaluatepagefunction-args)
* [frame.evaluateHandle(pageFunction[, ...args])](#frameevaluatehandlepagefunction-args)
Expand Down Expand Up @@ -3905,6 +3906,12 @@ const [response] = await Promise.all([
]);
```

#### frame.client()

- returns: <[Promise]<[CDPSession]>>

Returns the CDP session associated with the frame.

#### frame.content()

- returns: <[Promise]<[string]>>
Expand Down
7 changes: 7 additions & 0 deletions src/common/FrameManager.ts
Expand Up @@ -792,6 +792,13 @@ export class Frame {
return this._mainWorld.executionContext();
}

/**
* @returns the CDP session associated with the frame.
*/
client(): CDPSession {
return this._client;
}

/**
* @remarks
*
Expand Down

0 comments on commit 13e772d

Please sign in to comment.