From: Stephen Niedzielski Date: Fri, 27 Nov 2015 06:16:00 +0000 (-0700) Subject: Update docs for webContents.addWorkSpace X-Git-Tag: v0.35.2~2^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=62c65280a177a50ba9d3aac8c2de4ee8a9908564;p=electron.git Update docs for webContents.addWorkSpace Specify that webContents.addWorkSpace cannot be called before DevTools creation and include example. Fix: #3536 --- diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 2612d621..e976b0dd 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -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)`