diff --git a/bluetooth-rename/index.html b/bluetooth-rename/index.html index bc8a85c..5cfe535 100644 --- a/bluetooth-rename/index.html +++ b/bluetooth-rename/index.html @@ -144,14 +144,6 @@

Done!

writeNameButton.disabled = false; } - function anyDeviceFilter() { - // This is the closest we can get for now to get all devices. - // https://github.com/WebBluetoothCG/web-bluetooth/issues/234 - return Array.from('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') - .map(c => ({namePrefix: c})) - .concat({name: ''}); - } - connectButton.addEventListener('click', function () { progress.hidden = false; disableInput(); @@ -161,7 +153,8 @@

Done!

throw "No Web Bluetooth support."; return navigator.bluetooth.requestDevice({ - filters: anyDeviceFilter(), + // filters: [...] <- Prefer filters to save energy & show relevant devices. + acceptAllDevices:true, optionalServices: ['generic_access'] }) })