-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support process singleton with IBrowserProcessHandler.OnAlreadyRunningAppRelaunch callback #4668
Comments
Same here in our WPF application. Debug.log from v120.1.110
Looks like it's related to the process singleton enabled by default and a virtual function |
The only
The
That's not really something
We need to add |
///
/// Implement this method to provide app-specific behavior when an already
/// running app is relaunched with the same CefSettings.root_cache_path value.
/// For example, activate an existing app window or create a new app window.
/// |command_line| will be read-only. Do not keep a reference to
/// |command_line| outside of this method. Return true if the relaunch is
/// handled or false for default relaunch behavior. Default behavior will
/// create a new default styled Chrome window.
///
/// To avoid cache corruption only a single app instance is allowed to run for
/// a given CefSettings.root_cache_path value. On relaunch the app checks a
/// process singleton lock and then forwards the new launch arguments to the
/// already running app process before exiting early. Client apps should
/// therefore check the CefInitialize() return value for early exit before
/// proceeding.
///
/// This method will be called on the browser process UI thread.
///
/*--cef(optional_param=current_directory)--*/
virtual bool OnAlreadyRunningAppRelaunch(
CefRefPtr<CefCommandLine> command_line,
const CefString& current_directory) {
return false;
}
As per |
Ok, got it, thanks |
CEF thinks your application has relaunched with a
Load Again from a If your application doesn't have a cache set then you'll need to raise an issue at https://github.com/chromiumembedded/cef/issues as that would be an upstream bug. |
@amaitland Is there a function to get the default root cache path? |
If the second process call to |
Looks like
Someone will need to raise an issue at https://github.com/chromiumembedded/cef/issues |
Problem reproduces with the CEF sample application, only appears to be a problem when Upstream issue chromiumembedded/cef#3635 You can try integrating |
The upstream issue has been resolved. If I'm reading the fix correctly the
|
Is there an existing issue for this?
CefSharp Version
120.1.110
Operating System
Windows 11
Architecture
x64
.Net Version
.NET 4.7.2
Implementation
WinForms
Reproduction Steps
Reproducible with CefSharp.MinimalExample since
120.1.110
(cefsharp/CefSharp.MinimalExample@136a65e).Just launch the application twice.
Expected behavior
A second launch of the application should be possible (without any restrictions).
Actual behavior
A launch of any more instances result in a crash.
This is the output of the
debug.log
from the second launch:Regression?
This was working with v120.1.80.
Known Workarounds
No known workarounds
Does this problem also occur in the CEF Sample Application
No
Other information
No response
The text was updated successfully, but these errors were encountered: