Closed ckearney-nitro closed 8 months ago
the cache_path for both CefRequestContextSettings and CefSettings to be the same as root_cahe_path
This uses the same global request context, so global scheme registration is used.
CefRequestContextSettings context_settings = {}; auto request_context = CefRequestContext::CreateContext(context_settings, nullptr);
This creates a new/isolated request context, so you need to call CefRequestContext::RegisterSchemeHandlerFactory.
Describe the bug CEF is unable to load resource when using a custom schemes and the browser is in incognito mode (cache_path is empty).
To Reproduce
I have a class ClientApp which is derived from
CefApp
and implementsOnRegisterCustomSchemes
to add my custom schemeI call 'CefInitialize' with my client app and settings listed above and I can see the 'OnRegisterCustomSchemes' callback being called. After a successful
CefInitialize
, I then register my scheme handler factory. Classdll_resource_scheme_handler
implements the create functionCefSchemeHandlerFactory
When it comes to creating the browser:
The object passed into client_handler parameter implements the
OnLoadError
function, and that function is called with these parmeters by CEF.Expected behavior I would expect the URL scheme to be known if the is the browser is in incognito mode.
When the browser is not in incognito mode (the
cache_path
for bothCefRequestContextSettings
andCefSettings
to be the same asroot_cahe_path
). I don't get theOnLoadError
call.Screenshots The screenshot shows the order of some functions being call from handlers. On the left is a successful run, when the application is not in incognito mode and on the right is when the application is in incognito mode.
Versions (please complete the following information):