From 0d3aee26b9e653e27ae6fe9d28586fd0a87fe2a7 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 7 Mar 2023 15:36:31 -0500 Subject: [PATCH] docs: fixup WebUSB fiddle (#37455) docs: fixup webusb fiddle --- docs/fiddles/features/web-usb/main.js | 2 -- docs/fiddles/features/web-usb/renderer.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/fiddles/features/web-usb/main.js b/docs/fiddles/features/web-usb/main.js index 580c6686bcc3..14983093c6bb 100644 --- a/docs/fiddles/features/web-usb/main.js +++ b/docs/fiddles/features/web-usb/main.js @@ -1,5 +1,4 @@ const {app, BrowserWindow} = require('electron') -const e = require('express') const path = require('path') function createWindow () { @@ -44,7 +43,6 @@ function createWindow () { } }) - mainWindow.webContents.session.setDevicePermissionHandler((details) => { if (details.deviceType === 'usb' && details.origin === 'file://') { if (!grantedDeviceThroughPermHandler) { diff --git a/docs/fiddles/features/web-usb/renderer.js b/docs/fiddles/features/web-usb/renderer.js index 3983a6fbf773..8544353f0fb9 100644 --- a/docs/fiddles/features/web-usb/renderer.js +++ b/docs/fiddles/features/web-usb/renderer.js @@ -1,5 +1,5 @@ function getDeviceDetails(device) { - return grantedDevice.productName || `Unknown device ${grantedDevice.deviceId}` + return device.productName || `Unknown device ${device.deviceId}` } async function testIt() {