docs: Update codes in docs to use require('electron')
This commit is contained in:
parent
8b2942c279
commit
eac2e7cc61
32 changed files with 134 additions and 157 deletions
|
@ -24,14 +24,15 @@ Then you can load the extension in Electron by opening DevTools in any window,
|
|||
and running the following code in the DevTools console:
|
||||
|
||||
```javascript
|
||||
require('remote').require('browser-window').addDevToolsExtension('/some-directory/react-devtools/shells/chrome');
|
||||
const BrowserWindow = require('electron').remote.require('electron').BrowserWindow;
|
||||
BrowserWindow.addDevToolsExtension('/some-directory/react-devtools/shells/chrome');
|
||||
```
|
||||
|
||||
To unload the extension, you can call the `BrowserWindow.removeDevToolsExtension`
|
||||
API with its name and it will not load the next time you open the DevTools:
|
||||
|
||||
```javascript
|
||||
require('remote').require('browser-window').removeDevToolsExtension('React Developer Tools');
|
||||
BrowserWindow.removeDevToolsExtension('React Developer Tools');
|
||||
```
|
||||
|
||||
## Format of DevTools Extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue