observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Allow access to Serial #527

Open MAKIO135 opened 1 year ago

MAKIO135 commented 1 year ago

Is your feature request related to a problem? Please describe. I'm trying to use Observable combined with the WebSerial API, in order to send generated SVG to a plotter directly from Observable, but the access to Serial is not allowed to the iframe running the script.
See error in console when trying to access Serial on https://observablehq.com/@makio135/observable-and-webserial-api for example.

Describe the solution you'd like I'd like to see the access to Serial allowed to the iframe context.

Describe alternatives you've considered Alternative is porting my workflow with Observable.

mootari commented 1 year ago

Another alternative is to request access in a top-level window. See the example here: https://observablehq.com/@mootari/powerful-features#serial

mootari commented 1 year ago

For reference, here is the permission: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/serial