Skip to content

Commit 05755ba

Browse files
moshfeuCheng Zhao
authored andcommitted
docs: show the code of adding devtools extension (electron#16186)
1 parent 0881fd6 commit 05755ba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/tutorial/devtools-extension.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ Using the [React Developer Tools][react-devtools] as example:
2929
* on macOS it is `~/Library/Application Support/Google/Chrome/Default/Extensions`.
3030
1. Pass the location of the extension to `BrowserWindow.addDevToolsExtension`
3131
API, for the React Developer Tools, it is something like:
32-
`~/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0`
32+
```javascript
33+
const path = require('path')
34+
const os = require('os')
35+
36+
BrowserWindow.addDevToolsExtension(
37+
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0')
38+
)
39+
```
3340

3441
**Note:** The `BrowserWindow.addDevToolsExtension` API cannot be called before the
3542
ready event of the app module is emitted.

0 commit comments

Comments
 (0)