mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-12 22:07:39 +02:00
Added 2 new TChromiumCore properties
Added TChromium.JavascriptEnabled to enable/disable JS at runtime. Added TChromium.LoadImagesAutomatically to enable/disable image loading at runtime.
This commit is contained in:
parent
e36cd5e8c7
commit
cfeee87c30
@ -141,6 +141,8 @@ type
|
|||||||
FDefaultWindowInfoExStyle : cardinal;
|
FDefaultWindowInfoExStyle : cardinal;
|
||||||
FNetworkPredictions : TCefNetworkPredictionOptions;
|
FNetworkPredictions : TCefNetworkPredictionOptions;
|
||||||
FQuicAllowed : boolean;
|
FQuicAllowed : boolean;
|
||||||
|
FJavascriptEnabled : boolean;
|
||||||
|
FLoadImagesAutomatically : boolean;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
FOldBrowserCompWndPrc : TFNWndProc;
|
FOldBrowserCompWndPrc : TFNWndProc;
|
||||||
@ -391,6 +393,8 @@ type
|
|||||||
procedure SetMultiBrowserMode(aValue : boolean);
|
procedure SetMultiBrowserMode(aValue : boolean);
|
||||||
procedure SetNetworkPredictions(aValue : TCefNetworkPredictionOptions);
|
procedure SetNetworkPredictions(aValue : TCefNetworkPredictionOptions);
|
||||||
procedure SetQuicAllowed(aValue : boolean);
|
procedure SetQuicAllowed(aValue : boolean);
|
||||||
|
procedure SetJavascriptEnabled(aValue : boolean);
|
||||||
|
procedure SetLoadImagesAutomatically(aValue : boolean);
|
||||||
|
|
||||||
function CreateBrowserHost(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aExtraInfo : ICefDictionaryValue; const aContext : ICefRequestContext): boolean;
|
function CreateBrowserHost(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aExtraInfo : ICefDictionaryValue; const aContext : ICefRequestContext): boolean;
|
||||||
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aExtraInfo : ICefDictionaryValue; const aContext : ICefRequestContext): Boolean;
|
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aExtraInfo : ICefDictionaryValue; const aContext : ICefRequestContext): Boolean;
|
||||||
@ -880,6 +884,8 @@ type
|
|||||||
property Offline : boolean read FOffline write SetOffline;
|
property Offline : boolean read FOffline write SetOffline;
|
||||||
property NetworkPredictions : TCefNetworkPredictionOptions read FNetworkPredictions write SetNetworkPredictions;
|
property NetworkPredictions : TCefNetworkPredictionOptions read FNetworkPredictions write SetNetworkPredictions;
|
||||||
property QuicAllowed : boolean read FQuicAllowed write SetQuicAllowed;
|
property QuicAllowed : boolean read FQuicAllowed write SetQuicAllowed;
|
||||||
|
property JavascriptEnabled : boolean read FJavascriptEnabled write SetJavascriptEnabled;
|
||||||
|
property LoadImagesAutomatically : boolean read FLoadImagesAutomatically write SetLoadImagesAutomatically;
|
||||||
|
|
||||||
property WebRTCIPHandlingPolicy : TCefWebRTCHandlingPolicy read FWebRTCIPHandlingPolicy write SetWebRTCIPHandlingPolicy;
|
property WebRTCIPHandlingPolicy : TCefWebRTCHandlingPolicy read FWebRTCIPHandlingPolicy write SetWebRTCIPHandlingPolicy;
|
||||||
property WebRTCMultipleRoutes : TCefState read FWebRTCMultipleRoutes write SetWebRTCMultipleRoutes;
|
property WebRTCMultipleRoutes : TCefState read FWebRTCMultipleRoutes write SetWebRTCMultipleRoutes;
|
||||||
@ -1190,6 +1196,8 @@ begin
|
|||||||
FOffline := False;
|
FOffline := False;
|
||||||
FNetworkPredictions := CEF_NETWORK_PREDICTION_WIFI_ONLY;
|
FNetworkPredictions := CEF_NETWORK_PREDICTION_WIFI_ONLY;
|
||||||
FQuicAllowed := True;
|
FQuicAllowed := True;
|
||||||
|
FJavascriptEnabled := True;
|
||||||
|
FLoadImagesAutomatically := True;
|
||||||
|
|
||||||
if (GlobalCEFApp <> nil) then
|
if (GlobalCEFApp <> nil) then
|
||||||
FHyperlinkAuditing := GlobalCEFApp.HyperlinkAuditing
|
FHyperlinkAuditing := GlobalCEFApp.HyperlinkAuditing
|
||||||
@ -2707,6 +2715,24 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.SetJavascriptEnabled(aValue : boolean);
|
||||||
|
begin
|
||||||
|
if (FJavascriptEnabled <> aValue) then
|
||||||
|
begin
|
||||||
|
FJavascriptEnabled := aValue;
|
||||||
|
FUpdatePreferences := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromiumCore.SetLoadImagesAutomatically(aValue : boolean);
|
||||||
|
begin
|
||||||
|
if (FLoadImagesAutomatically <> aValue) then
|
||||||
|
begin
|
||||||
|
FLoadImagesAutomatically := aValue;
|
||||||
|
FUpdatePreferences := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.SetAudioMuted(aValue : boolean);
|
procedure TChromiumCore.SetAudioMuted(aValue : boolean);
|
||||||
begin
|
begin
|
||||||
if Initialized then
|
if Initialized then
|
||||||
@ -3933,6 +3959,9 @@ begin
|
|||||||
|
|
||||||
UpdatePreference(aBrowser, 'net.network_prediction_options', integer(FNetworkPredictions));
|
UpdatePreference(aBrowser, 'net.network_prediction_options', integer(FNetworkPredictions));
|
||||||
UpdatePreference(aBrowser, 'net.quic_allowed', FQuicAllowed);
|
UpdatePreference(aBrowser, 'net.quic_allowed', FQuicAllowed);
|
||||||
|
|
||||||
|
UpdatePreference(aBrowser, 'webkit.webprefs.javascript_enabled', FJavascriptEnabled);
|
||||||
|
UpdatePreference(aBrowser, 'webkit.webprefs.loads_images_automatically', FLoadImagesAutomatically);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumCore.doUpdateOwnPreferences;
|
procedure TChromiumCore.doUpdateOwnPreferences;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 177,
|
"InternalVersion" : 178,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "84.4.1.0"
|
"Version" : "84.4.1.0"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user