mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
Add systemPreferences.removeUserDefault()
This can be used to restore the default or global value of a `key` previously set with `setUserDefault`.
This commit is contained in:
@@ -112,9 +112,9 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSNotificati
|
||||
* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`,
|
||||
`url`, `array`, `dictionary`
|
||||
|
||||
Returns `any` - The value of `key` in system preferences.
|
||||
Returns `any` - The value of `key` in `NSUserDefaults`.
|
||||
|
||||
This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
Some popular `key` and `type`s are:
|
||||
|
||||
* `AppleInterfaceStyle`: `string`
|
||||
* `AppleAquaColorVariant`: `integer`
|
||||
@@ -130,15 +130,22 @@ This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
* `type` String - See [`getUserDefault`][#systempreferencesgetuserdefaultkey-type-macos]
|
||||
* `value` String
|
||||
|
||||
Set the value of `key` in system preferences.
|
||||
Set the value of `key` in `NSUserDefaults`.
|
||||
|
||||
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:
|
||||
Some popular `key` and `type`s are:
|
||||
|
||||
* `ApplePressAndHoldEnabled`: `boolean`
|
||||
|
||||
### `systemPreferences.removeUserDefault(key)` _macOS_
|
||||
|
||||
* `key` String
|
||||
|
||||
Removes the `key` in `NSUserDefaults`. This can be used to restore the default
|
||||
or global value of a `key` previously set with `setUserDefault`.
|
||||
|
||||
### `systemPreferences.isAeroGlassEnabled()` _Windows_
|
||||
|
||||
Returns `Boolean` - `true` if [DWM composition][dwm-composition] (Aero Glass) is
|
||||
|
||||
Reference in New Issue
Block a user