Fixed exceptions when you tried to used empty languages list and set a managed preference

This commit is contained in:
Salvador Díaz Fau 2020-04-20 12:02:16 +02:00
parent 62c310a7b9
commit 9a0c782064
2 changed files with 16 additions and 3 deletions

View File

@ -3277,6 +3277,8 @@ begin
end;
procedure TChromiumCore.doUpdatePreferences(const aBrowser: ICefBrowser);
var
TempLanguagesList : ustring;
begin
FUpdatePreferences := False;
@ -3295,7 +3297,19 @@ begin
UpdatePreference(aBrowser, 'settings.force_google_safesearch', FSafeSearch);
UpdatePreference(aBrowser, 'settings.force_youtube_restrict', FYouTubeRestrict);
UpdatePreference(aBrowser, 'printing.enabled', FPrintingEnabled);
UpdatePreference(aBrowser, 'intl.accept_languages', FAcceptLanguageList);
TempLanguagesList := FAcceptLanguageList;
if (length(TempLanguagesList) = 0) then
TempLanguagesList := FOptions.AcceptLanguageList;
if (length(TempLanguagesList) = 0) then
TempLanguagesList := GlobalCEFApp.AcceptLanguageList;
if (length(TempLanguagesList) = 0) then
TempLanguagesList := 'en-US,en';
UpdatePreference(aBrowser, 'intl.accept_languages', TempLanguagesList);
case FAcceptCookies of
cpAllow : UpdatePreference(aBrowser, 'profile.default_content_setting_values.cookies', CEF_COOKIE_PREF_ALLOW);
@ -3303,7 +3317,6 @@ begin
else UpdatePreference(aBrowser, 'profile.default_content_setting_values.cookies', CEF_COOKIE_PREF_DEFAULT);
end;
UpdatePreference(aBrowser, 'profile.managed_default_content_settings.cookies', CEF_COOKIE_PREF_DEFAULT);
UpdatePreference(aBrowser, 'profile.block_third_party_cookies', FBlock3rdPartyCookies);
if (FMaxConnectionsPerProxy <> CEF_MAX_CONNECTIONS_PER_PROXY_DEFAULT_VALUE) then

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 119,
"InternalVersion" : 120,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "81.2.17.0"
}