docs: Move devtools methods to WebContents
This commit is contained in:
parent
ef4014e14b
commit
af971a46bd
2 changed files with 57 additions and 57 deletions
|
@ -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()`
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue