docs: update Node global symbols example to use contextBridge (#28245)
* docs: update Node global symbols example to use contextBridge * Trigger Build * docs: change Node API example to show how to expose a crypto API Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * docs: Fix lint warning for crypto code sample * docs: update node API example description to emphasize APIs instead of symbols Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
parent
c8d18a0a1c
commit
8c3165434a
3 changed files with 21 additions and 15 deletions
|
@ -45,19 +45,6 @@ In sandboxed renderers the `process` object contains only a subset of the APIs:
|
|||
Emitted when Electron has loaded its internal initialization script and is
|
||||
beginning to load the web page or the main script.
|
||||
|
||||
It can be used by the preload script to add removed Node global symbols back to
|
||||
the global scope when node integration is turned off:
|
||||
|
||||
```javascript
|
||||
// preload.js
|
||||
const _setImmediate = setImmediate
|
||||
const _clearImmediate = clearImmediate
|
||||
process.once('loaded', () => {
|
||||
global.setImmediate = _setImmediate
|
||||
global.clearImmediate = _clearImmediate
|
||||
})
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
### `process.defaultApp` _Readonly_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue