cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ali1234
Making moves
Status: New idea

Web-based IDEs like Arduino and Github Codespaces are now commonplace. They are hobbled in Firefox due to an inability to access development boards without installing extra system software, which rather defeats the purpose of having an IDE that runs in your browser. This is not the case on Chrome, where Web USB and Web Serial can be used. (Clarification: they *could* be used on Chrome, but often are not because developers don't want to maintain two separate codebases.)

I will preempt the response I have received every previous time I brought up this topic: Web USB and Web Serial present no more of a security risk than web camera or location data, and Firefox already has a permissions system to protect those. On the other hand, the software you have to install to make Arduino IDE work in Firefox starts a webserver that shares your serial port over a websocket, just so that your browser can connect to it. It isn't clear if there are any protections at all on that websocket.

I will also note than the current prevalence of web-based development environments is in part due to Mozilla's insistence that everything should be able to run in the browser, along with projects like Firefox OS.

https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API

https://developer.mozilla.org/en-US/docs/Web/API/USB

118 Comments
gregstoll
Employee
Employee

@mhalano @Tyeth We don't have any updates on WebUSB right now - that spec is more complicated and we have some additional security concerns.

gregstoll
Employee
Employee

@griffi-gh @Tyeth Thanks for those examples! We have confirmed that some devices will work over Bluetooth, but we also know that Chrome does some additional things to make more devices work that we haven't implemented. There's more information at bug 2013908.

Jason2866
New member

@gregstoll Flash write works for esp32x devices. The way more time critical flash read process fails.

My ESP Webflasher https://github.com/Jason2866/esp-web-tools does work. My esp32tool https://github.com/Jason2866/esp32tool to write and read flash does fail in any read task. Both tools work when using Edge or Chrome.

gregstoll
Employee
Employee

@Jason2866 Thanks for the report! Have you tried this with a recent build? We added significant read performance improvements in bug 2021345.

Jason2866
New member

@gregstoll Yes, tried with the nightly build from 16-05-26

Jason2866
New member

@gregstoll EDIT. Used a too old build. The actual nightly does work. Great!!

Jason2866
New member

The read performance is better as with Chrome. Until now i have not seen any read recovery retry attempt in my code. So the read performance is perfect!!!

gregstoll
Employee
Employee

@Jason2866 Glad to hear it!

gregstoll
Employee
Employee

We're happy to announce that Firefox 151 (shipping now!) has support for Web Serial! There's a bit more information here: https://blog.mozilla.org/en/firefox/firefox-web-serial-adafruit/

As always, feel free to report problems here or by filing a bug at https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=DOM%3A+Device+Interfaces

HarlemSquirrel
Strollin' around

🎊Woot! I wish we could react to posts here!

mhalano
Making moves

Now we just need the WebUSB protocol. There is this interesting tool called DriftGuard, but it seems just Web Serial doesn't work, it requires WebUSB: https://driftguard.app/#dashboard

griffi-gh
Strollin' around

Seems like WebSerial is forcefully disabled on latest Nighlty again on linux, dom.webserial.enabled is set to false for me with a gray padlock and I cannot change it

gregstoll
Employee
Employee

@griffi-gh Do you have any policies set? If so, this is because of bug 2038282 ( https://bugzilla.mozilla.org/show_bug.cgi?id=2038282 ), and you should set the DefaultSerialGuardSetting policy to 3 to enable WebSerial.