mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
feat: add USB protected classes handler (#38263)
* feat: add USB protected classes handler * chore: apply review suggestions Co-authored-by: Charles Kerr <charles@charleskerr.com> * chore: update docs * chore: apply review suggestions * update doc per suggestion --------- Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
committed by
GitHub
parent
71fb19ea14
commit
b4ec363b3d
@@ -51,6 +51,13 @@ function createWindow () {
|
||||
}
|
||||
})
|
||||
|
||||
mainWindow.webContents.session.setUSBProtectedClassesHandler((details) => {
|
||||
return details.protectedClasses.filter((usbClass) => {
|
||||
// Exclude classes except for audio classes
|
||||
return usbClass.indexOf('audio') === -1
|
||||
})
|
||||
})
|
||||
|
||||
mainWindow.loadFile('index.html')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user