mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Merge pull request #8084 from poiru/systempreferences-setuserdefault
Add systemPreferences.setUserDefault for macOS
This commit is contained in:
@@ -114,16 +114,30 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSNotificati
|
||||
|
||||
Get the value of `key` in system preferences.
|
||||
|
||||
This API reads from `NSUserDefaults` on macOS, some popular `key` and `type`s
|
||||
are:
|
||||
This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
|
||||
* `AppleInterfaceStyle: string`
|
||||
* `AppleAquaColorVariant: integer`
|
||||
* `AppleHighlightColor: string`
|
||||
* `AppleShowScrollBars: string`
|
||||
* `NSNavRecentPlaces: array`
|
||||
* `NSPreferredWebServices: dictionary`
|
||||
* `NSUserDictionaryReplacementItems: array`
|
||||
* `AppleInterfaceStyle`: `string`
|
||||
* `AppleAquaColorVariant`: `integer`
|
||||
* `AppleHighlightColor`: `string`
|
||||
* `AppleShowScrollBars`: `string`
|
||||
* `NSNavRecentPlaces`: `array`
|
||||
* `NSPreferredWebServices`: `dictionary`
|
||||
* `NSUserDictionaryReplacementItems`: `array`
|
||||
|
||||
### `systemPreferences.setUserDefault(key, type, value)` _macOS_
|
||||
|
||||
* `key` String
|
||||
* `type` String - See [`getUserDefault`][#systempreferencesgetuserdefaultkey-type-macos]
|
||||
* `value` String
|
||||
|
||||
Set the value of `key` in system preferences.
|
||||
|
||||
Note that `type` should match actual type of `value`. An exception is thrown
|
||||
if they don't.
|
||||
|
||||
This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
|
||||
* `ApplePressAndHoldEnabled`: `boolean`
|
||||
|
||||
### `systemPreferences.isAeroGlassEnabled()` _Windows_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user