Skip to content

thegecko/webusb-web-extension

Repository files navigation

WebUSB Web Extension

VS Code Web Extension demonstrating WebUSB access

Prerequisites

A VS Code Web build available which includes microsoft/vscode#152310

Description

WebUSB devices can be accessed from web extensions running in the web extension host webworker here:

https://github.com/thegecko/webusb-web-extension/blob/main/src/browser/commands.ts#L23

WebUSB devices need to be authorised before being accessed and this is possible due to the new workbench.experimental.requestUsbDevice command.

This is triggered from the webview here:

https://github.com/thegecko/webusb-web-extension/blob/main/src/views/webusb-view.ts#L7

but run in the webworker here:

https://github.com/thegecko/webusb-web-extension/blob/main/src/views/webusb-main.ts#L25

Screenshot

Screenshot 2022-03-31 at 13 51 08

About

VS Code Web Extension demonstrating WebUSB access

Resources

Stars

Watchers

Forks

Packages

No packages published