Devices in requestDevice dialog can have blank names |
||||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36
Steps to reproduce the problem:
Plug in PixelC in fastboot mode
Execute navigator.usb.requestDevice({filters:[]})
What is the expected behavior?
Device is listed with some kind of name
What went wrong?
Device is listed with an empty name (no text) in the device chooser dialog.
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 54.0.2840.100 Channel: stable
OS Version:
Flash Version: Shockwave Flash 23.0 r0
It doesn't appear the device actually exposes any strings that Chrome could use, but lsusb at least seems to be able to tell it's a Google Inc. device based on the vendor id. Maybe Chrome could do the same (Google Inc. Device). Or at least display Unknown Device.
,
Nov 16 2016
,
Nov 17 2016
Fixing this will be necessary for merging the chooser UI for navigator.usb.requestDevice and chrome.usb.getUserSelectedDevices so I'm assigning this task to juncai@. As mentioned offline something that chrome.usb.getUserSelectedDevices has to deal with is devices that don't have string descriptors. The logic I suggest implementing is displaying, in decreasing order of preference: 1. UsbDevice::product_string() [Current logic.] 2. UsbIds::GetProductName() 3. "Unknown device from " + UsbIds::GetVendorName() 4. "Unknown device [$VID:$PID]"
,
Nov 17 2016
,
Nov 28 2016
,
Nov 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/06198969e3c76b4999cbdf1a474bb4f94ee275cd commit 06198969e3c76b4999cbdf1a474bb4f94ee275cd Author: juncai <juncai@chromium.org> Date: Tue Nov 29 17:23:27 2016 Fix blank names issue for navigator.usb.requestDevice Sometimes UsbDevice::product_string() returns empty string, and the current WebUSB chooser uses it as the device name to be displayed. This CL fixes the blank name issue by displaying, in decreasing order of preference: 1. UsbDevice::product_string() 2. UsbIds::GetProductName() 3. "Unknown device from " + UsbIds::GetVendorName() 4. "Unknown device [$VID:$PID]" BUG= 665599 Review-Url: https://codereview.chromium.org/2539593002 Cr-Commit-Position: refs/heads/master@{#435019} [modify] https://crrev.com/06198969e3c76b4999cbdf1a474bb4f94ee275cd/chrome/app/generated_resources.grd [modify] https://crrev.com/06198969e3c76b4999cbdf1a474bb4f94ee275cd/chrome/browser/usb/usb_chooser_controller.cc
,
Nov 29 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by reillyg@chromium.org
, Nov 15 2016