feat: webFrameMain.fromFrameToken (#47850)

* feat: webFrameMain.fromFrameToken

* refactor: return null instead of undefined

* docs: mention renderer webFrame property

* chore: undo null->undefined in wfm.fromId api
this will be updated in another pr
This commit is contained in:
Sam Maddock
2025-07-31 16:41:44 -04:00
committed by GitHub
parent 18af498cf1
commit 25e2459f31
5 changed files with 55 additions and 3 deletions

View File

@@ -66,6 +66,16 @@ These methods can be accessed from the `webFrameMain` module:
Returns `WebFrameMain | undefined` - A frame with the given process and routing IDs,
or `undefined` if there is no WebFrameMain associated with the given IDs.
### `webFrameMain.fromFrameToken(processId, frameToken)`
* `processId` Integer - An `Integer` representing the internal ID of the process which owns the frame.
* `frameToken` string - A `string` token identifying the unique frame. Can also
be retrieved in the renderer process via
[`webFrame.frameToken`](web-frame.md#webframeframetoken-readonly).
Returns `WebFrameMain | null` - A frame with the given process and frame token,
or `null` if there is no WebFrameMain associated with the given IDs.
## Class: WebFrameMain
Process: [Main](../glossary.md#main-process)<br />