зеркало из https://github.com/electron/electron.git
docs: mark contextBridge as experimental (#20638)
* docs: mark contextBridge as experimental This commit didn't make it to the original PR, quick addition here * Update context-bridge.md
This commit is contained in:
Родитель
3ac3fbdbfb
Коммит
2b890827ef
|
@ -40,7 +40,7 @@ context isolation and what it affects in the [BrowserWindow](browser-window.md)
|
|||
|
||||
The `contextBridge` module has the following methods:
|
||||
|
||||
### `contextBridge.exposeInMainWorld(apiKey, api)`
|
||||
### `contextBridge.exposeInMainWorld(apiKey, api)` _Experimental_
|
||||
|
||||
* `apiKey` String - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
|
||||
* `api` Record<String, any> - Your API object, more information on what this API can be and how it works is available below.
|
||||
|
@ -49,7 +49,7 @@ The `contextBridge` module has the following methods:
|
|||
|
||||
### API Objects
|
||||
|
||||
The `api` object provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api) must be an object
|
||||
The `api` object provided to [`exposeInMainWorld`](#contextbridgeexposeinmainworldapikey-api-experimental) must be an object
|
||||
whose keys are strings and values are a `Function`, `String`, `Number`, `Array`, `Boolean` or another nested object that meets the same conditions.
|
||||
|
||||
`Function` values are proxied to the other context and all other values are **copied** and **frozen**. I.e. Any data / primitives sent in
|
||||
|
|
Загрузка…
Ссылка в новой задаче