feat: deprecate modules internally using remote.require in sandboxed renderer context (#15145)

This commit is contained in:
Milan Burda 2018-12-05 10:34:09 +01:00 committed by Alexey Kuzmin
parent d5d1fa8290
commit d561c5531b
12 changed files with 71 additions and 8 deletions

View file

@ -65,6 +65,39 @@ not present, then the native module will fail to load on Windows, with an error
message like `Cannot find module`. See the [native module
guide](/docs/tutorial/using-native-node-modules.md) for more.
## `electron.screen` in renderer process
```js
// Deprecated
require('electron').screen
// Replace with
require('electron').remote.screen
```
## `require` in sandboxed renderers
```js
// Deprecated
require('child_process')
// Replace with
require('electron').remote.require('child_process')
// Deprecated
require('fs')
// Replace with
require('electron').remote.require('fs')
// Deprecated
require('os')
// Replace with
require('electron').remote.require('os')
// Deprecated
require('path')
// Replace with
require('electron').remote.require('path')
```
# Breaking API Changes (3.0)