chore: initial linting fixes for JS in docs/fiddles (#37689)
This commit is contained in:
parent
be32740991
commit
db27b9f433
45 changed files with 122 additions and 134 deletions
|
@ -1,8 +1,8 @@
|
|||
function getDeviceDetails(device) {
|
||||
function getDeviceDetails (device) {
|
||||
return device.productName || `Unknown device ${device.deviceId}`
|
||||
}
|
||||
|
||||
async function testIt() {
|
||||
async function testIt () {
|
||||
const noDevicesFoundMsg = 'No devices found'
|
||||
const grantedDevices = await navigator.usb.getDevices()
|
||||
let grantedDeviceList = ''
|
||||
|
@ -21,7 +21,6 @@ async function testIt() {
|
|||
filters: []
|
||||
})
|
||||
grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>`
|
||||
|
||||
} catch (ex) {
|
||||
if (ex.name === 'NotFoundError') {
|
||||
grantedDeviceList = noDevicesFoundMsg
|
||||
|
@ -30,4 +29,4 @@ async function testIt() {
|
|||
document.getElementById('granted-devices2').innerHTML = grantedDeviceList
|
||||
}
|
||||
|
||||
document.getElementById('clickme').addEventListener('click',testIt)
|
||||
document.getElementById('clickme').addEventListener('click', testIt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue