]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Move devtools methods to WebContents
authorCheng Zhao <zcbenz@gmail.com>
Thu, 1 Oct 2015 08:30:31 +0000 (16:30 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 1 Oct 2015 08:30:31 +0000 (16:30 +0800)
docs/api/browser-window.md
docs/api/web-contents.md

index c71cb610fc18756b17931e9c308813fe5b2470e2..1a2870f205ae1d69329a7a4eb71d579a144fd7cd 100644 (file)
@@ -231,18 +231,6 @@ Emitted when the window enters full screen state triggered by html api.
 
 Emitted when the window leaves full screen state triggered by html api.
 
-### Event: 'devtools-opened'
-
-Emitted when DevTools is opened.
-
-### Event: 'devtools-closed'
-
-Emitted when DevTools is closed.
-
-### Event: 'devtools-focused'
-
-Emitted when DevTools is focused / opened.
-
 ### Event: 'app-command':
 
 Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx)
@@ -317,16 +305,6 @@ operations will be done via it.
 See the [`webContents` documentation](web-contents.md) for its methods and
 events.
 
-**Note:** Users should never store this object because it may become `null`
-when the renderer process (web page) has crashed.
-
-### `win.devToolsWebContents`
-
-Get the `WebContents` of DevTools for this window.
-
-**Note:** Users should never store this object because it may become `null`
-when the DevTools has been closed.
-
 ### `win.id`
 
 The unique ID of this window.
@@ -595,41 +573,6 @@ bar will become grey when set to `true`.
 
 Whether the window's document has been edited.
 
-### `win.openDevTools([options])`
-
-* `options` Object (optional). Properties:
-  * `detach` Boolean - opens DevTools in a new window
-
-Opens the developer tools.
-
-### `win.closeDevTools()`
-
-Closes the developer tools.
-
-### `win.isDevToolsOpened()`
-
-Returns whether the developer tools are opened.
-
-### `win.toggleDevTools()`
-
-Toggles the developer tools.
-
-### `win.isDevToolsFocused()`
-
-Returns whether the developer tools is focused.
-
-### `win.inspectElement(x, y)`
-
-* `x` Integer
-* `y` Integer
-
-Starts inspecting element at position (`x`, `y`).
-
-### `win.inspectServiceWorker()`
-
-Opens the developer tools for the service worker context present in the web
-contents.
-
 ### `win.focusOnWebView()`
 
 ### `win.blurWebView()`
index 7cbf8d93ba2c5af74180a2782637df4a97d51bf3..08670bad9df7fb3ea23e0f45238bd8bd4717abf0 100644 (file)
@@ -154,6 +154,18 @@ Emitted when a plugin process has crashed.
 
 Emitted when `webContents` is destroyed.
 
+### Event: 'devtools-opened'
+
+Emitted when DevTools is opened.
+
+### Event: 'devtools-closed'
+
+Emitted when DevTools is closed.
+
+### Event: 'devtools-focused'
+
+Emitted when DevTools is focused / opened.
+
 ## Instance Methods
 
 The `webContents` object has the following instance methods:
@@ -441,6 +453,40 @@ Adds the specified path to DevTools workspace.
 
 Removes the specified path from DevTools workspace.
 
+### `webContents.openDevTools([options])`
+
+* `options` Object (optional). Properties:
+  * `detach` Boolean - opens DevTools in a new window
+
+Opens the developer tools.
+
+### `webContents.closeDevTools()`
+
+Closes the developer tools.
+
+### `webContents.isDevToolsOpened()`
+
+Returns whether the developer tools are opened.
+
+### `webContents.toggleDevTools()`
+
+Toggles the developer tools.
+
+### `webContents.isDevToolsFocused()`
+
+Returns whether the developer tools is focused.
+
+### `webContents.inspectElement(x, y)`
+
+* `x` Integer
+* `y` Integer
+
+Starts inspecting element at position (`x`, `y`).
+
+### `webContents.inspectServiceWorker()`
+
+Opens the developer tools for the service worker context.
+
 ### `webContents.send(channel[, args...])`
 
 * `channel` String
@@ -574,3 +620,14 @@ is in 32bit ARGB format).
 ### `webContents.endFrameSubscription()`
 
 End subscribing for frame presentation events.
+
+## Instance Properties
+
+`WebContents` objects also have the following properties:
+
+### `webContents.devToolsWebContents`
+
+Get the `WebContents` of DevTools for this `WebContents`.
+
+**Note:** Users should never store this object because it may become `null`
+when the DevTools has been closed.