Re: [web-bluetooth] Allow filtering by device name and name prefix in requestDevice().

> Why support a substring match only for prefix? If a substring match 
is supported why not for any portion of the string? I agree that most 
devices seem to use a prefix, but it's hard to be exhaustive. "Red 
Fish", "Blue Fish" seem reasonable names too.

The best thing to do might be to support a regex, but IIRC we'd have
trouble running that regex in the browser process where we need to
filter things.

Advertisements send a prefix of the device name, so we can be more
sure a device doesn't match a prefix than a substring. If we start
connecting to devices to check their filters, this would let us
connect to fewer, but we don't have plans to connect, so maybe it
doesn't matter.

> The substring can be as short as a single character. This starts to 
have fairly diminishing returns as a filter for security purposes. It 
makes me wonder why not support an empty filter too.

Yeah; maybe we should back off of insisting that folks filter? If they
want to produce a bad experience by letting users pick devices they
can't use, let them?


-- 
GitHub Notif of comment by jyasskin
See 
https://github.com/WebBluetoothCG/web-bluetooth/pull/174#issuecomment-152641680

Received on Friday, 30 October 2015 20:17:16 UTC