Add "dev-tools-opened" and "dev-tools-closed" events.
This commit is contained in:
parent
8051ad8b2a
commit
a59388ecdd
2 changed files with 12 additions and 0 deletions
|
@ -35,6 +35,10 @@ BrowserWindow::openDevTools = ->
|
|||
@devToolsWebContents = @getDevToolsWebContents()
|
||||
@devToolsWebContents.once 'destroyed', => @devToolsWebContents = null
|
||||
|
||||
# Emit devtools events.
|
||||
@emit 'dev-tools-opened'
|
||||
@devToolsWebContents.once 'destroyed', => @emit 'dev-tools-closed'
|
||||
|
||||
BrowserWindow::toggleDevTools = ->
|
||||
if @isDevToolsOpened() then @closeDevTools() else @openDevTools()
|
||||
|
||||
|
|
|
@ -138,6 +138,14 @@ Emitted when window loses focus.
|
|||
|
||||
Emitted when window gains focus.
|
||||
|
||||
### Event: 'dev-tools-opened'
|
||||
|
||||
Emitted when devtools is opened.
|
||||
|
||||
### Event: 'dev-tools-closed'
|
||||
|
||||
Emitted when devtools is closed.
|
||||
|
||||
### Class Method: BrowserWindow.getAllWindows()
|
||||
|
||||
Returns an array of all opened browser windows.
|
||||
|
|
Loading…
Reference in a new issue