-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: persist permission granted to serial ports #30209
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
Conversation
Release Notes Persisted
|
I was unable to backport this PR to "12-x-y" cleanly; |
I was unable to backport this PR to "13-x-y" cleanly; |
I was unable to backport this PR to "14-x-y" cleanly; |
I have automatically backported this PR to "15-x-y", please check out #30271 |
@jkleinsc Is this fix going to be backported to Electron v12? |
@jkleinsc does this need to get backported or should we remove the labels? I see the |
@codebytere #31181 should be backported instead for 15-x-y and 14-x-y. For 12 and 13 I will need to create a separate fix/backport because WebHID will not be backported there. |
@jkleinsc I just tested this in Electron v12.2.2 and it works great. Thanks again! 🙏 |
Description of Change
When I implemented web serial in #25237, I did not add logic to persist serial ports that permission has been granted due to complexity in getting ObjectPermissionContextBase working in Electron. This PR fixes that issue by adding functions to ElectronBrowserContext to persist and retrieve saved devices to/from the BrowserContext. These methods will also be used by the forthcoming WebHID implementation.
Fixes #29366
Checklist
npm test
passesRelease Notes
Notes: Fixed navigator.serial.getPorts() to return previously selected ports.