setDevToolsWebContents

fun setDevToolsWebContents(devToolsWebContents: WebContents)(source)

Uses the devToolsWebContents as the target WebContents to show DevTools.

The devToolsWebContents must not have done any navigation, and it should not be used for other purposes after the call.

By default, Electron manages the DevTools by creating an internal WebContents with native view, which developers have very limited control of. With the setDevToolsWebContents method, developers can use any WebContents to show the DevTools in it, such as BrowserWindow or WebContentsView.

Note that closing the DevTools does not destroy the devToolsWebContents, it is the caller's responsibility to destroy devToolsWebContents manually.

An example of showing DevTools in a BrowserWindow: