Add button to open devtools for stream views

This commit is contained in:
Max Goodhart
2020-06-21 19:25:21 -07:00
parent 555e5defa0
commit e79e2f7a75
4 changed files with 55 additions and 5 deletions

View File

@@ -81,6 +81,9 @@ const viewStateMachine = Machine(
},
MUTE: '.muted',
UNMUTE: '.listening',
DEVTOOLS: {
actions: 'openDevTools',
},
},
states: {
muted: {
@@ -109,6 +112,12 @@ const viewStateMachine = Machine(
unmuteAudio: (context, event) => {
context.view.webContents.audioMuted = false
},
openDevTools: (context, event) => {
const { view } = context
const { inWebContents } = event
view.webContents.setDevToolsWebContents(inWebContents)
view.webContents.openDevTools({ mode: 'detach' })
},
},
guards: {
contentUnchanged: (context, event) => {