mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 15:55:56 +01:00
Update to CEF 84.3.8
Improvements in the command line switches to avoid repetitions and make it easier to remove or modify default switches.
This commit is contained in:
parent
0f0c827b5d
commit
b3b9bf809e
@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
|
||||
|
||||
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
||||
|
||||
CEF4Delphi uses CEF 84.3.7 which includes Chromium 84.0.4147.89.
|
||||
CEF4Delphi uses CEF 84.3.8 which includes Chromium 84.0.4147.105.
|
||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_84.3.7%2Bg97011bc%2Bchromium-84.0.4147.89_windows32.tar.bz2)
|
||||
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_84.3.7%2Bg97011bc%2Bchromium-84.0.4147.89_windows64.tar.bz2)
|
||||
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_84.3.8%2Bgc8a556f%2Bchromium-84.0.4147.105_windows32.tar.bz2)
|
||||
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_84.3.8%2Bgc8a556f%2Bchromium-84.0.4147.105_windows64.tar.bz2)
|
||||
|
||||
|
||||
CEF4Delphi was developed and tested on Delphi 10.4 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.10/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
|
@ -21,7 +21,7 @@
|
||||
</CompilerOptions>
|
||||
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
|
||||
<License Value="MPL 1.1"/>
|
||||
<Version Major="84" Minor="3" Release="7"/>
|
||||
<Version Major="84" Minor="3" Release="8"/>
|
||||
<Files Count="189">
|
||||
<Item1>
|
||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||
|
@ -62,13 +62,13 @@ uses
|
||||
const
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 84;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 3;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 7;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 8;
|
||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||
|
||||
CEF_CHROMEELF_VERSION_MAJOR = 84;
|
||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||
CEF_CHROMEELF_VERSION_RELEASE = 4147;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 89;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 105;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
LIBCEF_DLL = 'libcef.dll';
|
||||
@ -323,6 +323,9 @@ type
|
||||
procedure ShowErrorMessageDlg(const aError : string); virtual;
|
||||
procedure UpdateSupportedSchemes(aIncludeDefaults : boolean = True); virtual;
|
||||
function ParseProcessType : TCefProcessType;
|
||||
procedure AddCustomCommandLineSwitches(var aKeys, aValues : TStringList); virtual;
|
||||
procedure AppendSwitch(var aKeys, aValues : TStringList; const aNewKey : ustring; const aNewValue : ustring = '');
|
||||
procedure ReplaceSwitch(var aKeys, aValues : TStringList; const aNewKey : ustring; const aNewValue : ustring = '');
|
||||
|
||||
public
|
||||
constructor Create;
|
||||
@ -1615,224 +1618,300 @@ begin
|
||||
FOnLoadError(browser, frame, errorCode, errorText, failedUrl);
|
||||
end;
|
||||
|
||||
procedure TCefApplicationCore.Internal_OnBeforeCommandLineProcessing(const processType : ustring;
|
||||
const commandLine : ICefCommandLine);
|
||||
procedure TCefApplicationCore.AppendSwitch(var aKeys, aValues : TStringList; const aNewKey, aNewValue : ustring);
|
||||
var
|
||||
TempKey : ustring;
|
||||
i : integer;
|
||||
begin
|
||||
if (copy(aNewKey, 1, 2) = '--') then
|
||||
TempKey := copy(aNewKey, 3, length(aNewKey))
|
||||
else
|
||||
TempKey := aNewKey;
|
||||
|
||||
i := aKeys.IndexOf(TempKey);
|
||||
|
||||
if (i < 0) then
|
||||
begin
|
||||
aKeys.Add(aNewKey);
|
||||
aValues.Add(aNewValue);
|
||||
end
|
||||
else
|
||||
aValues[i] := aValues[i] + ',' + aNewValue;
|
||||
end;
|
||||
|
||||
procedure TCefApplicationCore.ReplaceSwitch(var aKeys, aValues : TStringList; const aNewKey, aNewValue : ustring);
|
||||
var
|
||||
TempKey : ustring;
|
||||
i : integer;
|
||||
begin
|
||||
if (copy(aNewKey, 1, 2) = '--') then
|
||||
TempKey := copy(aNewKey, 3, length(aNewKey))
|
||||
else
|
||||
TempKey := aNewKey;
|
||||
|
||||
i := aKeys.IndexOf(TempKey);
|
||||
|
||||
if (i < 0) then
|
||||
begin
|
||||
aKeys.Add(aNewKey);
|
||||
aValues.Add(aNewValue);
|
||||
end
|
||||
else
|
||||
aValues[i] := aNewValue;
|
||||
end;
|
||||
|
||||
procedure TCefApplicationCore.AddCustomCommandLineSwitches(var aKeys, aValues : TStringList);
|
||||
var
|
||||
i : integer;
|
||||
{$IFDEF MSWINDOWS}
|
||||
TempVersionInfo : TFileVersionInfo;
|
||||
TempFileName : ustring;
|
||||
{$ENDIF}
|
||||
begin
|
||||
if (commandLine <> nil) and (FProcessType = ptBrowser) and (processType = '') then
|
||||
begin
|
||||
{$IFDEF MSWINDOWS}
|
||||
if FindFlashDLL(TempFileName) and
|
||||
GetDLLVersion(TempFileName, TempVersionInfo) then
|
||||
begin
|
||||
if FEnableGPU then commandLine.AppendSwitch('--enable-gpu-plugin');
|
||||
if FEnableGPU then ReplaceSwitch(aKeys, aValues, '--enable-gpu-plugin');
|
||||
|
||||
commandLine.AppendSwitch('--enable-accelerated-plugins');
|
||||
commandLine.AppendSwitchWithValue('--ppapi-flash-path', TempFileName);
|
||||
commandLine.AppendSwitchWithValue('--ppapi-flash-version', FileVersionInfoToString(TempVersionInfo));
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-accelerated-plugins');
|
||||
ReplaceSwitch(aKeys, aValues, '--ppapi-flash-path', TempFileName);
|
||||
ReplaceSwitch(aKeys, aValues, '--ppapi-flash-version', FileVersionInfoToString(TempVersionInfo));
|
||||
end
|
||||
else
|
||||
{$ENDIF}
|
||||
if FFlashEnabled then
|
||||
begin
|
||||
if FEnableGPU then commandLine.AppendSwitch('--enable-gpu-plugin');
|
||||
if FEnableGPU then ReplaceSwitch(aKeys, aValues, '--enable-gpu-plugin');
|
||||
|
||||
commandLine.AppendSwitch('--enable-accelerated-plugins');
|
||||
commandLine.AppendSwitch('--enable-system-flash');
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-accelerated-plugins');
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-system-flash');
|
||||
end;
|
||||
|
||||
commandLine.AppendSwitchWithValue('--enable-media-stream', IntToStr(Ord(FEnableMediaStream)));
|
||||
commandLine.AppendSwitchWithValue('--enable-speech-input', IntToStr(Ord(FEnableSpeechInput)));
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-media-stream', IntToStr(Ord(FEnableMediaStream)));
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-speech-input', IntToStr(Ord(FEnableSpeechInput)));
|
||||
|
||||
if FUseFakeUIForMediaStream then
|
||||
commandLine.AppendSwitch('--use-fake-ui-for-media-stream');
|
||||
ReplaceSwitch(aKeys, aValues, '--use-fake-ui-for-media-stream');
|
||||
|
||||
if not(FEnableGPU) then
|
||||
begin
|
||||
commandLine.AppendSwitch('--disable-gpu');
|
||||
commandLine.AppendSwitch('--disable-gpu-compositing');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-gpu');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-gpu-compositing');
|
||||
end;
|
||||
|
||||
if FSingleProcess then
|
||||
commandLine.AppendSwitch('--single-process');
|
||||
ReplaceSwitch(aKeys, aValues, '--single-process');
|
||||
|
||||
case FSmoothScrolling of
|
||||
STATE_ENABLED : commandLine.AppendSwitch('--enable-smooth-scrolling');
|
||||
STATE_DISABLED : commandLine.AppendSwitch('--disable-smooth-scrolling');
|
||||
STATE_ENABLED : ReplaceSwitch(aKeys, aValues, '--enable-smooth-scrolling');
|
||||
STATE_DISABLED : ReplaceSwitch(aKeys, aValues, '--disable-smooth-scrolling');
|
||||
end;
|
||||
|
||||
case FTouchEvents of
|
||||
STATE_ENABLED : commandLine.AppendSwitchWithValue('--touch-events', 'enabled');
|
||||
STATE_DISABLED : commandLine.AppendSwitchWithValue('--touch-events', 'disabled');
|
||||
STATE_ENABLED : ReplaceSwitch(aKeys, aValues, '--touch-events', 'enabled');
|
||||
STATE_DISABLED : ReplaceSwitch(aKeys, aValues, '--touch-events', 'disabled');
|
||||
end;
|
||||
|
||||
if FDisableReadingFromCanvas then
|
||||
commandLine.AppendSwitch('--disable-reading-from-canvas');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-reading-from-canvas');
|
||||
|
||||
if not(FHyperlinkAuditing) then
|
||||
commandLine.AppendSwitch('--no-pings');
|
||||
ReplaceSwitch(aKeys, aValues, '--no-pings');
|
||||
|
||||
case FAutoplayPolicy of
|
||||
appDocumentUserActivationRequired :
|
||||
commandLine.AppendSwitchWithValue('--autoplay-policy', 'document-user-activation-required');
|
||||
ReplaceSwitch(aKeys, aValues, '--autoplay-policy', 'document-user-activation-required');
|
||||
|
||||
appNoUserGestureRequired :
|
||||
commandLine.AppendSwitchWithValue('--autoplay-policy', 'no-user-gesture-required');
|
||||
ReplaceSwitch(aKeys, aValues, '--autoplay-policy', 'no-user-gesture-required');
|
||||
|
||||
appUserGestureRequired :
|
||||
commandLine.AppendSwitchWithValue('--autoplay-policy', 'user-gesture-required');
|
||||
ReplaceSwitch(aKeys, aValues, '--autoplay-policy', 'user-gesture-required');
|
||||
end;
|
||||
|
||||
if FFastUnload then
|
||||
commandLine.AppendSwitch('--enable-fast-unload');
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-fast-unload');
|
||||
|
||||
if FDisableGPUCache then
|
||||
commandLine.AppendSwitch('--disable-gpu-shader-disk-cache');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-gpu-shader-disk-cache');
|
||||
|
||||
if FDisableSafeBrowsing then
|
||||
begin
|
||||
commandLine.AppendSwitch('--disable-client-side-phishing-detection');
|
||||
commandLine.AppendSwitch('--safebrowsing-disable-auto-update');
|
||||
commandLine.AppendSwitch('--safebrowsing-disable-download-protection');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-client-side-phishing-detection');
|
||||
ReplaceSwitch(aKeys, aValues, '--safebrowsing-disable-auto-update');
|
||||
ReplaceSwitch(aKeys, aValues, '--safebrowsing-disable-download-protection');
|
||||
end;
|
||||
|
||||
if FMuteAudio then
|
||||
commandLine.AppendSwitch('--mute-audio');
|
||||
ReplaceSwitch(aKeys, aValues, '--mute-audio');
|
||||
|
||||
if FDisableWebSecurity then
|
||||
commandLine.AppendSwitch('--disable-web-security');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-web-security');
|
||||
|
||||
if FDisablePDFExtension then
|
||||
commandLine.AppendSwitch('--disable-pdf-extension');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-pdf-extension');
|
||||
|
||||
if FDisableSiteIsolationTrials then
|
||||
commandLine.AppendSwitch('--disable-site-isolation-trials');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-site-isolation-trials');
|
||||
|
||||
if FSitePerProcess then
|
||||
commandLine.AppendSwitch('--site-per-process');
|
||||
ReplaceSwitch(aKeys, aValues, '--site-per-process');
|
||||
|
||||
if FDisableExtensions then
|
||||
commandLine.AppendSwitch('--disable-extensions');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-extensions');
|
||||
|
||||
if FDisableBackgroundNetworking then
|
||||
commandLine.AppendSwitch('--disable-background-networking');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-background-networking');
|
||||
|
||||
if FMetricsRecordingOnly then
|
||||
commandLine.AppendSwitch('--metrics-recording-only');
|
||||
ReplaceSwitch(aKeys, aValues, '--metrics-recording-only');
|
||||
|
||||
if FAllowFileAccessFromFiles then
|
||||
commandLine.AppendSwitch('--allow-file-access-from-files');
|
||||
ReplaceSwitch(aKeys, aValues, '--allow-file-access-from-files');
|
||||
|
||||
if FAllowRunningInsecureContent then
|
||||
commandLine.AppendSwitch('--allow-running-insecure-content');
|
||||
ReplaceSwitch(aKeys, aValues, '--allow-running-insecure-content');
|
||||
|
||||
if FEnablePrintPreview then
|
||||
commandLine.AppendSwitch('--enable-print-preview');
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-print-preview');
|
||||
|
||||
if FDisableNewBrowserInfoTimeout then
|
||||
commandLine.AppendSwitch('--disable-new-browser-info-timeout');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-new-browser-info-timeout');
|
||||
|
||||
if (length(FDevToolsProtocolLogFile) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--devtools-protocol-log-file', FDevToolsProtocolLogFile);
|
||||
ReplaceSwitch(aKeys, aValues, '--devtools-protocol-log-file', FDevToolsProtocolLogFile);
|
||||
|
||||
case FPluginPolicy of
|
||||
PLUGIN_POLICY_SWITCH_DETECT : commandLine.AppendSwitchWithValue('--plugin-policy', 'detect');
|
||||
PLUGIN_POLICY_SWITCH_BLOCK : commandLine.AppendSwitchWithValue('--plugin-policy', 'block');
|
||||
PLUGIN_POLICY_SWITCH_DETECT : ReplaceSwitch(aKeys, aValues, '--plugin-policy', 'detect');
|
||||
PLUGIN_POLICY_SWITCH_BLOCK : ReplaceSwitch(aKeys, aValues, '--plugin-policy', 'block');
|
||||
end;
|
||||
|
||||
if (length(FDefaultEncoding) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--default-encoding', FDefaultEncoding);
|
||||
ReplaceSwitch(aKeys, aValues, '--default-encoding', FDefaultEncoding);
|
||||
|
||||
if FDisableJavascript then
|
||||
commandLine.AppendSwitch('--disable-javascript');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-javascript');
|
||||
|
||||
if FDisableJavascriptCloseWindows then
|
||||
commandLine.AppendSwitch('--disable-javascript-close-windows');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-javascript-close-windows');
|
||||
|
||||
if FDisableJavascriptAccessClipboard then
|
||||
commandLine.AppendSwitch('--disable-javascript-access-clipboard');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-javascript-access-clipboard');
|
||||
|
||||
if FDisableJavascriptDomPaste then
|
||||
commandLine.AppendSwitch('--disable-javascript-dom-paste');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-javascript-dom-paste');
|
||||
|
||||
if FAllowUniversalAccessFromFileUrls then
|
||||
commandLine.AppendSwitch('--allow-universal-access-from-files');
|
||||
ReplaceSwitch(aKeys, aValues, '--allow-universal-access-from-files');
|
||||
|
||||
if FDisableImageLoading then
|
||||
commandLine.AppendSwitch('--disable-image-loading');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-image-loading');
|
||||
|
||||
if FImageShrinkStandaloneToFit then
|
||||
commandLine.AppendSwitch('--image-shrink-standalone-to-fit');
|
||||
ReplaceSwitch(aKeys, aValues, '--image-shrink-standalone-to-fit');
|
||||
|
||||
if FDisableTextAreaResize then
|
||||
commandLine.AppendSwitch('--disable-text-area-resize');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-text-area-resize');
|
||||
|
||||
if FDisableTabToLinks then
|
||||
commandLine.AppendSwitch('--disable-tab-to-links');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-tab-to-links');
|
||||
|
||||
if FDisablePlugins then
|
||||
commandLine.AppendSwitch('--disable-plugins');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-plugins');
|
||||
|
||||
if FEnableProfanityFilter then
|
||||
commandLine.AppendSwitch('--enable-profanity-filter');
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-profanity-filter');
|
||||
|
||||
if FDisableSpellChecking then
|
||||
commandLine.AppendSwitch('--disable-spell-checking');
|
||||
ReplaceSwitch(aKeys, aValues, '--disable-spell-checking');
|
||||
|
||||
if (length(FOverrideSpellCheckLang) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--override-spell-check-lang', FOverrideSpellCheckLang);
|
||||
|
||||
ReplaceSwitch(aKeys, aValues, '--override-spell-check-lang', FOverrideSpellCheckLang);
|
||||
|
||||
// The list of features you can enable is here :
|
||||
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
||||
if (length(FEnableFeatures) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--enable-features', FEnableFeatures);
|
||||
AppendSwitch(aKeys, aValues, '--enable-features', FEnableFeatures);
|
||||
|
||||
// The list of features you can disable is here :
|
||||
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
||||
if (length(FDisableFeatures) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--disable-features', FDisableFeatures);
|
||||
AppendSwitch(aKeys, aValues, '--disable-features', FDisableFeatures);
|
||||
|
||||
// The list of Blink features you can enable is here :
|
||||
// https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
if (length(FEnableBlinkFeatures) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--enable-blink-features', FEnableBlinkFeatures);
|
||||
AppendSwitch(aKeys, aValues, '--enable-blink-features', FEnableBlinkFeatures);
|
||||
|
||||
// The list of Blink features you can disable is here :
|
||||
// https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
if (length(FDisableBlinkFeatures) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--disable-blink-features', FDisableBlinkFeatures);
|
||||
AppendSwitch(aKeys, aValues, '--disable-blink-features', FDisableBlinkFeatures);
|
||||
|
||||
// https://source.chromium.org/chromium/chromium/src/+/master:base/base_switches.cc
|
||||
if (length(FForceFieldTrials) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--force-fieldtrials', FForceFieldTrials);
|
||||
ReplaceSwitch(aKeys, aValues, '--force-fieldtrials', FForceFieldTrials);
|
||||
|
||||
// https://source.chromium.org/chromium/chromium/src/+/master:components/variations/variations_switches.cc
|
||||
if (length(FForceFieldTrialParams) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--force-fieldtrial-params', FForceFieldTrialParams);
|
||||
ReplaceSwitch(aKeys, aValues, '--force-fieldtrial-params', FForceFieldTrialParams);
|
||||
|
||||
if (FCustomCommandLines <> nil) and
|
||||
(FCustomCommandLineValues <> nil) and
|
||||
(FCustomCommandLines.Count = FCustomCommandLineValues.Count) then
|
||||
begin
|
||||
i := 0;
|
||||
|
||||
while (i < FCustomCommandLines.Count) do
|
||||
begin
|
||||
if (length(FCustomCommandLines[i]) > 0) then
|
||||
ReplaceSwitch(aKeys, aValues, FCustomCommandLines[i], FCustomCommandLineValues[i]);
|
||||
|
||||
inc(i);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCefApplicationCore.Internal_OnBeforeCommandLineProcessing(const processType : ustring;
|
||||
const commandLine : ICefCommandLine);
|
||||
var
|
||||
i : integer;
|
||||
TempKeys, TempValues : TStringList;
|
||||
begin
|
||||
if (length(FCustomCommandLineValues[i]) > 0) then
|
||||
commandLine.AppendSwitchWithValue(FCustomCommandLines[i], FCustomCommandLineValues[i])
|
||||
TempKeys := nil;
|
||||
TempValues := nil;
|
||||
|
||||
try
|
||||
if (commandLine <> nil) and
|
||||
commandLine.IsValid and
|
||||
(FProcessType = ptBrowser) and
|
||||
(processType = '') then
|
||||
begin
|
||||
TempKeys := TStringList.Create;
|
||||
TempValues := TStringList.Create;
|
||||
commandLine.GetSwitches(TempKeys, TempValues);
|
||||
|
||||
AddCustomCommandLineSwitches(TempKeys, TempValues);
|
||||
|
||||
commandLine.Reset;
|
||||
|
||||
i := 0;
|
||||
while (i < TempKeys.Count) do
|
||||
begin
|
||||
if (length(TempKeys[i]) > 0) then
|
||||
begin
|
||||
if (length(TempValues[i]) > 0) then
|
||||
commandLine.AppendSwitchWithValue(TempKeys[i], TempValues[i])
|
||||
else
|
||||
commandLine.AppendSwitch(FCustomCommandLines[i]);
|
||||
commandLine.AppendSwitch(TempKeys[i]);
|
||||
end;
|
||||
|
||||
inc(i);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
if (TempKeys <> nil) then FreeAndNil(TempKeys);
|
||||
if (TempValues <> nil) then FreeAndNil(TempValues);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -72,7 +72,8 @@ type
|
||||
function HasSwitches: Boolean;
|
||||
function HasSwitch(const name: ustring): Boolean;
|
||||
function GetSwitchValue(const name: ustring): ustring;
|
||||
procedure GetSwitches(var switches: TStrings);
|
||||
function GetSwitches(var switches: TStrings): boolean; overload;
|
||||
function GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean; overload;
|
||||
procedure AppendSwitch(const name: ustring);
|
||||
procedure AppendSwitchWithValue(const name, value: ustring);
|
||||
function HasArguments: Boolean;
|
||||
@ -155,12 +156,13 @@ begin
|
||||
Result := CefStringFreeAndGet(PCefCommandLine(FData)^.get_program(PCefCommandLine(FData)));
|
||||
end;
|
||||
|
||||
procedure TCefCommandLineRef.GetSwitches(var switches: TStrings);
|
||||
function TCefCommandLineRef.GetSwitches(var switches: TStrings): boolean;
|
||||
var
|
||||
TempStrMap : ICefStringMap;
|
||||
i, j : NativeUInt;
|
||||
TempKey, TempValue : ustring;
|
||||
begin
|
||||
Result := False;
|
||||
TempStrMap := nil;
|
||||
|
||||
try
|
||||
@ -189,6 +191,44 @@ begin
|
||||
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
Result := (j > 0);
|
||||
end;
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCefCommandLineRef.GetSwitches', e) then raise;
|
||||
end;
|
||||
finally
|
||||
TempStrMap := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCefCommandLineRef.GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean;
|
||||
var
|
||||
TempStrMap : ICefStringMap;
|
||||
i, j : NativeUInt;
|
||||
begin
|
||||
Result := False;
|
||||
TempStrMap := nil;
|
||||
|
||||
try
|
||||
try
|
||||
if (SwitchKeys <> nil) and (SwitchValues <> nil) then
|
||||
begin
|
||||
TempStrMap := TCefStringMapOwn.Create;
|
||||
PCefCommandLine(FData)^.get_switches(PCefCommandLine(FData), TempStrMap.Handle);
|
||||
|
||||
i := 0;
|
||||
j := TempStrMap.Size;
|
||||
|
||||
while (i < j) do
|
||||
begin
|
||||
SwitchKeys.Add(TempStrMap.Key[i]);
|
||||
SwitchValues.Add(TempStrMap.Value[i]);
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
Result := (j > 0);
|
||||
end;
|
||||
except
|
||||
on e : exception do
|
||||
|
@ -1289,7 +1289,8 @@ type
|
||||
function HasSwitches: Boolean;
|
||||
function HasSwitch(const name: ustring): Boolean;
|
||||
function GetSwitchValue(const name: ustring): ustring;
|
||||
procedure GetSwitches(var switches: TStrings);
|
||||
function GetSwitches(var switches: TStrings): boolean; overload;
|
||||
function GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean; overload;
|
||||
procedure AppendSwitch(const name: ustring);
|
||||
procedure AppendSwitchWithValue(const name, value: ustring);
|
||||
function HasArguments: Boolean;
|
||||
|
@ -2,9 +2,9 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 170,
|
||||
"InternalVersion" : 171,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "84.3.7.0"
|
||||
"Version" : "84.3.8.0"
|
||||
}
|
||||
],
|
||||
"UpdatePackageData" : {
|
||||
|
Loading…
Reference in New Issue
Block a user