Skip to content

Commit

Permalink
docs: fix typescript error in code samples (#35654)
Browse files Browse the repository at this point in the history
Fixed typescript error

Co-authored-by: Leon Schwanitz <leon@28minds.com>
  • Loading branch information
trop[bot] and leonschwanitz committed Sep 13, 2022
1 parent d3976e6 commit 178db41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/fiddles/features/web-serial/main.js
Expand Up @@ -28,12 +28,16 @@ function createWindow () {
if (permission === 'serial' && details.securityOrigin === 'file:///') {
return true
}

return false
})

mainWindow.webContents.session.setDevicePermissionHandler((details) => {
if (details.deviceType === 'serial' && details.origin === 'file://') {
return true
}

return false
})

mainWindow.loadFile('index.html')
Expand Down

0 comments on commit 178db41

Please sign in to comment.