Update docs for webContents.addWorkSpace

Specify that webContents.addWorkSpace cannot be called before DevTools
creation and include example.

Fix: #3536
This commit is contained in:
Stephen Niedzielski 2015-11-26 23:16:00 -07:00
parent 42454b07d0
commit 62c65280a1

View 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)`