3 posts • Page 1 of 1
As you can see in the PopupBrowser2 demo you only need to call TChromium.CreateClientHandler and send a message to show the hidden popup window.
In case you just want to create a new browser window manually with a request context that shares the storage with the main request context then you would have to call TChromium.ShareRequestContext before calling TChromium.CreateBrowser.
You would have to call ShareRequestContext on the main browser and it will return a ICefRequestContext instance that you can use in the TChromium.CreateBrowser call to create the new browser.
This is what the CEF code comments say about TChromium.ShareRequestContext :
Creates a new context object that shares storage with |other| and uses an optional |handler|.
Cookies are stored inside the cache directory. If your application uses RAM memory to store the cache then the cookies will disappear when you close your application.
Thank you, is there a way to combine 2 Contexts into one? Now I do this:
I need to start a popupwindow with other files cookies, I used to do this :
Code: Select all
Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]); Chromium1.ShareRequestContext(PopUpContext); TestCreate(PopUpContext, targetUrl); procedure TestCreate(context : ICefRequestContext; url : string); var TempChromium: TChromium; begin TempChromium := TChromium.Create(Application); try TempChromium.DefaultUrl := url; TempContext := context; if not(TempChromium.CreateBrowser(CEFWindowParent2, '', TempContext)) and not(TempChromium.Initialized) then exit; except exit; end; end;
But if I change it, the page doesn't load in the new chromium.
Code: Select all
TempContext := TCefRequestContextRef.New(ExtractFilePath(Application.ExeName) +'cache\user2', '', True, True, True);