if not(Chromium1.CreateBrowser(CEFWindowParent1)) then
Timer1
if not(Chromium1.CreateBrowser(CEFWindowParent1)) and
not(Chromium1.Initialized) then
////////////
TempContext := TCefRequestContextRef.New('', '', '', False, False,False, Chromium1.ReqContextHandler);
Chromium1.CreateBrowser(CEFWindowParent1, '', TempContext);
//////////////
I'm curious about the difference between the two.
Proxy also seems to be affected. There is no problem if I do it the second time, but if I proxy it the first time and use it on another computer, I cannot connect because it is already connected. Is there a difference?
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.
Chromium1.CreateBrowser question
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Chromium1.CreateBrowser question
Hi,
All the browsers created with a aContext parameter set to NIL will use the global context and all of them will share the same settings, cache, etc.
Creating a browser with a new ICefRequestContext instance allows you to have an independent browser with different settings, cache, etc.
See the MDIBrowser demo :
https://github.com/salvadordf/CEF4Delphi/blob/be0efab35e624317514b6614f1771d7f4c446e8c/demos/Delphi_VCL/MDIBrowser/uChildForm.pas#L172
All the browsers created with a aContext parameter set to NIL will use the global context and all of them will share the same settings, cache, etc.
Creating a browser with a new ICefRequestContext instance allows you to have an independent browser with different settings, cache, etc.
See the MDIBrowser demo :
https://github.com/salvadordf/CEF4Delphi/blob/be0efab35e624317514b6614f1771d7f4c446e8c/demos/Delphi_VCL/MDIBrowser/uChildForm.pas#L172
Re: Chromium1.CreateBrowser question
TempContext := TCefRequestContextRef.New('', '', '', False, False, True, nil);
TempContext := TCefRequestContextRef.New('', '', '', False, False, True, Chromium1.ReqContextHandler);
What's the difference?
TempContext := TCefRequestContextRef.New('', '', '', False, False, True, Chromium1.ReqContextHandler);
What's the difference?
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Chromium1.CreateBrowser question
The Handlers are used to expose Delphi events among other things.
Creating a TCefRequestContextRef instance with a Chromium1.ReqContextHandler means that the TChromiumCore instance will get TChromiumCore.OnRequestContextInitialized and TChromiumCore.OnGetResourceRequestHandler_ReqCtxHdlr events.
Creating a TCefRequestContextRef instance with a Chromium1.ReqContextHandler means that the TChromiumCore instance will get TChromiumCore.OnRequestContextInitialized and TChromiumCore.OnGetResourceRequestHandler_ReqCtxHdlr events.