Unfortunately the obvious way of doing this with WebUSB is, from a security perspective, equivalent to giving the online IDE the ability to install arbitrary code. The Arduinos with sophisticated enough USB stacks to support WebUSB can also be reprogrammed by sketches to emulate a keyboard and inject keystrokes, including a series of keystrokes that downloads and executes a malicious executable.