docs: show the code of adding devtools extension (#16186)
This commit is contained in:
parent
0881fd6397
commit
05755ba202
1 changed files with 8 additions and 1 deletions
|
@ -29,7 +29,14 @@ Using the [React Developer Tools][react-devtools] as example:
|
||||||
* on macOS it is `~/Library/Application Support/Google/Chrome/Default/Extensions`.
|
* on macOS it is `~/Library/Application Support/Google/Chrome/Default/Extensions`.
|
||||||
1. Pass the location of the extension to `BrowserWindow.addDevToolsExtension`
|
1. Pass the location of the extension to `BrowserWindow.addDevToolsExtension`
|
||||||
API, for the React Developer Tools, it is something like:
|
API, for the React Developer Tools, it is something like:
|
||||||
`~/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0`
|
```javascript
|
||||||
|
const path = require('path')
|
||||||
|
const os = require('os')
|
||||||
|
|
||||||
|
BrowserWindow.addDevToolsExtension(
|
||||||
|
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0')
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
**Note:** The `BrowserWindow.addDevToolsExtension` API cannot be called before the
|
**Note:** The `BrowserWindow.addDevToolsExtension` API cannot be called before the
|
||||||
ready event of the app module is emitted.
|
ready event of the app module is emitted.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue