Page 1 of 1

Using UpdatePreference with dictionary

Posted: Sat Jun 09, 2018 11:35 am
by petko
Is it possible somehow to set CEF setting, which accepts values of type 'dictionary'? I want to set multiple spelling dictionaries. In C# CEF this is handled as following, but I don't see dictionary version of UpdatePreference in Cef4Delphi:

Code: Select all

var rc = cwb.GetBrowser().GetHost().RequestContext;
string error;
var dicts = new List<string>();
dicts.Add( "en-US" );
dicts.Add( "de-DE" );
dicts.Add( "fr-FR" );
rc.SetPreference( "browser.enable_spellchecking", true, out error );
rc.SetPreference( "spellcheck.dictionaries", dicts, out error );

Re: Using UpdatePreference with dictionary

Posted: Sat Jun 09, 2018 12:40 pm
by salvadordf
The TChromium.UpdateProxyPrefs function in uCEFChromium.pas has an example about setting preferences with a ICefDictionaryValue.

I haven't checked but the dictionaries preference that you mention might need a ICefListValue instead of a ICefDictionaryValue. You should set a ICefListValue in a similar way than ICefDictionaryValue.

Re: Using UpdatePreference with dictionary

Posted: Sat Jun 09, 2018 8:04 pm
by petko
Thanks, it worked with the list value!