-
Notifications
You must be signed in to change notification settings - Fork 15k
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
feat: expose system preferences to utility process #42203
base: main
Are you sure you want to change the base?
Conversation
lib/utility/api/module-list.ts
Outdated
@@ -1,4 +1,5 @@ | |||
// Utility side modules, please sort alphabetically. | |||
export const utilityNodeModuleList: ElectronInternal.ModuleEntry[] = [ | |||
{ name: 'net', loader: () => require('./net') } | |||
{ name: 'net', loader: () => require('./net') }, | |||
{ name: 'systemPreferences', loader: () => require('./system-preferences') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just map this to the @browser
file? no need to copy paste the impl I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done- uses @electron/internal/browser/api/system-preferences now. However, the net module and some others all re-copy: any insights as to why we chose to do that
Description of Change
This PR enables
systemPreferences
to be used within a utility process fork and not only the main process.Motive
systemPreferences.getMediaAccessStatus
only returns accurate permissions-states at the start of a user's session, but may not reflect permission changes made to the app until the app full quits/restarts. This can lead to silent failures when we attempt to access a device when the permissions have been revoked mid-session.Being able to call this function from within the Utility Module will allow for accurate permission state retrieval.
Testing
[x] added test
[x] manually verified change with gist
Release Notes
Notes: expose
systemPreferences
toutilityProcess