From 62c65280a177a50ba9d3aac8c2de4ee8a9908564 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Thu, 26 Nov 2015 23:16:00 -0700 Subject: [PATCH] Update docs for webContents.addWorkSpace Specify that webContents.addWorkSpace cannot be called before DevTools creation and include example. Fix: #3536 --- docs/api/web-contents.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 2612d6212279..e976b0ddb814 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)`