Re: [blink-dev] WebUSB - access from Chrome extension ?

21 views
Skip to first unread message

Reilly Grant

unread,
Nov 4, 2016, 11:49:54 AM11/4/16
to andy...@googlemail.com, phis...@gmail.com, web...@chromium.org
[Moving this thread from blink-dev to webusb.]

What problem are you trying to solve by using a Chrome Extension instead of hosting the page on an HTTPS server? If you need the content to be available offline that can be solved with Service Workers.

On Thu, Nov 3, 2016 at 6:00 PM andyweav via blink-dev <blin...@chromium.org> wrote:
Google is terminating Chrome Apps. What's the point to make the WebUSB work with Chrome Apps ?  We've been using Chrome Apps to access our hardware through serial port APIs. Now Google is killing Chrome Apps so we have to look at the alternatives. WebUSB + Chrome Extension seems to be the only solution at moment. 

Tired the extension without HTTPS server just now. It doesn't seem to work.


On Friday, November 4, 2016 at 1:56:39 AM UTC+8, Reilly Grant wrote:
I have plans to make the WebUSB API available from Chrome Apps as an alternative to the existing chrome.usb API but there are some technical challenges to integrating it with the Chrome Apps permission model that I haven't had time to work out. There is no plan at the moment to make WebUSB available from a Chrome Extension context.

On Thu, Nov 3, 2016 at 5:57 AM PhistucK <phis...@gmail.com> wrote:
I would imagine so, extensions are considered secure, I believe. Have you tried?
One of the problems is that Origin Trials cannot be enabled for extensions, I believe, so you must enable Web USB in about:flags.

Besides trying before asking (it should only take a few minutes), stackoverflow.com and chromium-extensions are more appropriate for Chrome extension questions. blink-dev is for open web platform contexts only.


PhistucK

On Thu, Nov 3, 2016 at 2:53 PM, andyweav via blink-dev <blin...@chromium.org> wrote:
From the demo, I see the USB devices can be accessed from HTTPS website. We are writing a Chrome extension at moment, and want to access the USB device from our html page inside the extension without relying on a HTTPS server. Is is possible?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dhaval Patel

unread,
Nov 4, 2016, 2:12:19 PM11/4/16
to WebUSB, andy...@googlemail.com, phis...@gmail.com
As Andy mentioned already Chrome Apps are going away and Google is pushing everyone to use other methods. If you insist on using Chrome Apps, you can access USB devices via the HID API https://developer.chrome.com/apps/hid but this will only work if your USB device is a HID device. 

If the device is NOT a HID device, you will need to use WebUSB and that only works via a HTTPS site.


Thanks,
Dhaval
Reply all
Reply to author
Forward
0 new messages