Skip to content

Commit b1685b4

Browse files
committed
Add CefSettings.PersistUserPreferences
Add RequestContextSettings.PersistUserPreferences To persist user preferences as a JSON file in the cache path directory set this value to true
1 parent 206ee07 commit b1685b4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CefSharp.Core/CefSettings.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,20 @@ namespace CefSharp
314314
void set(bool value) { _cefSettings->persist_session_cookies = value; }
315315
}
316316

317+
/// <summary>
318+
/// To persist user preferences as a JSON file in the cache path directory set
319+
/// this value to true. A CachePath value must also be specified
320+
/// to enable this feature. Also configurable using the
321+
/// "persist-user-preferences" command-line switch. Can be overridden for
322+
/// individual RequestContext instances via the
323+
/// RequestContextSettings.PersistUserPreferences value.
324+
/// </summary>
325+
property bool PersistUserPreferences
326+
{
327+
bool get() { return _cefSettings->persist_user_preferences == 1; }
328+
void set(bool value) { _cefSettings->persist_user_preferences = value; }
329+
}
330+
317331
/// <summary>
318332
/// Comma delimited ordered list of language codes without any whitespace that
319333
/// will be used in the "Accept-Language" HTTP header. May be set globally

CefSharp.Core/RequestContextSettings.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ namespace CefSharp
4949
void set(bool value) { _settings->persist_session_cookies = value; }
5050
}
5151

52+
/// <summary>
53+
/// To persist user preferences as a JSON file in the cache path directory set
54+
/// this value to true. Can be set globally using the
55+
/// CefSettings.PersistUserPreferences value. This value will be ignored if
56+
/// CachePath is empty or if it matches the CefSettings.CachePath value.
57+
/// </summary>
58+
property bool PersistUserPreferences
59+
{
60+
bool get() { return _settings->persist_user_preferences == 1; }
61+
void set(bool value) { _settings->persist_user_preferences = value; }
62+
}
63+
5264
/// <summary>
5365
/// The location where cache data will be stored on disk. If empty then
5466
/// browsers will be created in "incognito mode" where in-memory caches are

0 commit comments

Comments
 (0)