]> khamidou — GitHub mirrors - electron.git/commitdiff
Update docs for webContents.addWorkSpace
authorStephen Niedzielski <stephen@niedzielski.com>
Fri, 27 Nov 2015 06:16:00 +0000 (23:16 -0700)
committerStephen Niedzielski <stephen@niedzielski.com>
Fri, 27 Nov 2015 06:16:00 +0000 (23:16 -0700)
Specify that webContents.addWorkSpace cannot be called before DevTools
creation and include example.

Fix: #3536

docs/api/web-contents.md

index 2612d6212279b731863ed4e64c736d8837b5873d..e976b0ddb81441541ee49830693336a58283dc47 100644 (file)
@@ -499,7 +499,14 @@ win.webContents.on("did-finish-load", function() {
 
 * `path` String
 
-Adds the specified path to DevTools workspace.
+Adds the specified path to DevTools workspace. Must be used after DevTools
+creation:
+
+```javascript
+mainWindow.webContents.on('devtools-opened', function() {
+  mainWindow.webContents.addWorkSpace(__dirname);
+});
+```
 
 ### `webContents.removeWorkSpace(path)`