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.
form closes automatically
form closes automatically
good day!!!
TempContext := TCefRequestContextRef.New('Date\TG\Date\Accaunt\Accaunt0','Date\TG\Date\Accaunt\Accaunt0',False, False, False, False);
Chromium1.CreateBrowser(CEFWindowParent1,'Date\TG\Date\Accaunt\Accaunt0', TempContext);
the browser starts to close at 70% of the load, what could be the problem
TempContext := TCefRequestContextRef.New('Date\TG\Date\Accaunt\Accaunt0','Date\TG\Date\Accaunt\Accaunt0',False, False, False, False);
Chromium1.CreateBrowser(CEFWindowParent1,'Date\TG\Date\Accaunt\Accaunt0', TempContext);
the browser starts to close at 70% of the load, what could be the problem
Re: form closes automatically
It seems to me that it’s not even a matter of code, the folder with cookies is created, and then when you go to any site, the form with the browser just closes and that’s all, even though the folder with cookies changes.
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: form closes automatically
Hi,
The second parameter for TCefRequestContextRef.New is "aAcceptLanguageList". These are the code comments for that parameter :
The second parameter for TCefRequestContextRef.New is "aAcceptLanguageList". These are the code comments for that parameter :
Code: Select all
///
// Comma delimited ordered list of language codes without any whitespace that
// will be used in the "Accept-Language" HTTP header. Can be set globally
// using the CefSettings.accept_language_list value or overridden on a per-
// browser basis using the CefBrowserSettings.accept_language_list value. If
// all values are empty then "en-US,en" will be used. This value will be
// ignored if |cache_path| matches the CefSettings.cache_path value.
///
Re: form closes automatically
I don’t understand what, I just can’t understand why my browser closes when I open the site
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: form closes automatically
Try loading that website normally without a custom request context.
If it works, then try to use a custom request context but create it with empty parameters :
If it works, then try a full path to a directory with write privileges for the cache parameter.
If it works, then try to use a custom request context but create it with empty parameters :
Code: Select all
TempContext := TCefRequestContextRef.New('', '', False, False, False, False);
Re: form closes automatically
if use
TempContext := TCefRequestContextRef.New('','',False, False, False, False);
Chromium1.CreateBrowser(CEFWindowParent1,'', TempContext);
then everything works.
but this is not an option I need cookies in a separate folder
Re: form closes automatically
the most interesting thing is he creates a folder with cookies, and then the form just closes
Re: form closes automatically
helped the full path everything works, but it's not convenient since everyone has different drives
Re: form closes automatically
Now the site does not crash, but cookies do not load back, although all data has been recorded
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: form closes automatically
You have to set GlobalCEFApp.RootCache too. It's a new setting that needs to be used as a common parent for all the cache directories.
These are the code comments for GlobalCEFApp.RootCache :
These are the code comments for the cache parameter in TCefRequestContextRef.New :
These are the code comments for GlobalCEFApp.cache :
Please, make sure you use the latest version of CEF4Delphi because GlobalCEFApp.RootCache had an issue a few weeks ago.
These are the code comments for GlobalCEFApp.RootCache :
Code: Select all
///
// The root directory that all CefSettings.cache_path and
// CefRequestContextSettings.cache_path values must have in common. If this
// value is empty and CefSettings.cache_path is non-empty then this value will
// default to the CefSettings.cache_path value. Failure to set this value
// correctly may result in the sandbox blocking read/write access to the
// cache_path directory.
///
Code: Select all
///
// The location where cache data for this request context will be stored on
// disk. If non-empty this must be either equal to or a child directory of
// CefSettings.root_cache_path. If empty then browsers will be created in
// "incognito mode" where in-memory caches are used for storage and no data is
// persisted to disk. HTML5 databases such as localStorage will only persist
// across sessions if a cache path is specified. To share the global browser
// cache and related configuration set this value to match the
// CefSettings.cache_path value.
///
Code: Select all
///
// The location where data for the global browser cache will be stored on
// disk. If non-empty this must be either equal to or a child directory of
// CefSettings.root_cache_path. If empty then browsers will be created in
// "incognito mode" where in-memory caches are used for storage and no data is
// persisted to disk. HTML5 databases such as localStorage will only persist
// across sessions if a cache path is specified. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.cache_path value.
///