Skip to content

Commit 465a146

Browse files
add win.showDevTools callback example
1 parent d4ec606 commit 465a146

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

docs/References/Window.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Turn the window's native shadow on/off. Useful for frameless, transparent window
297297
The behavior of the function is changed since 0.13.0. Please see [Migration Notes from 0.12 to 0.13](../For Users/Migration/From 0.12 to 0.13.md).
298298

299299
* `iframe` `{String} or {HTMLIFrameElement}` _Optional_ the id or the element of the `<iframe>` to be jailed on. By default, the DevTools is shown for entire window.
300-
* `callback(dev_win)` `{Function}` callback with the native window of the DevTools window.
300+
* `callback(dev_win, error)` `{Function}` callback with the native window of the DevTools window.
301301

302302
Open the devtools to inspect the window.
303303

@@ -309,6 +309,14 @@ This function returns a `Window` object via the callback. You can use any proper
309309

310310
See also in [webview reference](webview Tag.md) on how to open DevTools for webview or open DevTools in a webview.
311311

312+
```js
313+
win.showDevTools((dev_win, error) => {
314+
if (error) {
315+
// handle error
316+
}
317+
});
318+
```
319+
312320
## win.closeDevTools()
313321

314322
!!! note

0 commit comments

Comments
 (0)