Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Using UpdatePreference with dictionary

Post Reply
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Using UpdatePreference with dictionary

Post 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 );
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Using UpdatePreference with dictionary

Post 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.
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Re: Using UpdatePreference with dictionary

Post by petko »

Thanks, it worked with the list value!
Post Reply