New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not use WebBluetooth function. #1900
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
Thank you for reporting! I did a little bit of research and unfortunately I don't know if it's possible to fix this at the moment. There's been an open issue in Chromium about it since 2015, and there apparently was an attempt to add this feature but it was abandoned 😢 If you use the "present" view, it should work, though I think if you are using it to do active development you will notice that it will cache previous versions of your sketch. I thought there was an open issue about this but I'm having a hard time finding it, so I will open an issue about that bug 😄 I know it's really frustrating to have a feature no longer work and not have an answer when it could be fixed. This is an issue that many other online code editors face as well—for example, someone made a bluetooth proxy example for Observable. Update: I was wrong about the caching issue. That issue only comes up with media files, see #1738, #1860. |
Thanks @catarak for your first analysis. v2.0.2 : This issue occurred. I hope it will help you to analyze. |
Yes! This issue is caused by #1894, but unfortunately the change protects the p5.js Editor against Cross Site Scripting (XSS) attacks. I would like to be able to enable bluetooth connects from within the sandboxed iframe but it seems like browsers unfortunately prevent this, which is super frustrating. |
Thx for your response. I got the current situation and fully understandable. |
Maybe there is hope? WebSerial is enabled currently on the editor. |
The other day, I found the item on Permission policy support for WebBluetooth in Chrome v104 release(roadmap) status below. I think this function might enable p5.js Web Editor(has cross-origin iframes) to support Web Bluetooth function and some libraries using the technology such as p5.ble.js, p5.toio and so on. Actually, OpenProcessing has just already supported it and it does work now! |
I agree, it does look like OpenProcessing is able to use WebBluetooth in its iframe successfully. @catarak could a similar solution be implemented for the P5 editor? I'm working on an EEG bluetooth template for ITP / IMA students who are new to code, and I'd love for it to work in the P5 editor rather than having them move over to VS Code. |
Hi everyone! I just tried to implement a solution for this, please reopen this issue or create a new one if the Web Bluetooth function still doesn't work! |
@raclim I have confirmed and p5.toio works fine! Thanks for your fixing! |
Nature of issue?
Details about the bug:
Hi all, I found that I could not use WebBluetooth function on the latest p5js web editor as of 2021/07/15. So, now we can NOT use p5.ble.js, p5.toio, and so on.
Please check the demos below.
p5.ble.js demo
p5.toio demo
I could surely use it in June 2021 so I think some recent changes might affect.
At least, this issue occurs on Chrome and Firefox environment.
Environment
Steps to reproduce this bug:
Usually, BLE connection dialog below opens and we can connect to the BLE peripheral.
Since WebBluetooth on P5 js web Editor is very easy to use and helpful for a lot of people, I hope this issue will be fixed.
The text was updated successfully, but these errors were encountered: