Closed razor999920 closed 3 months ago
Are you calling CefShutdown
? Is your application crashing?
No I'm not calling CefShutdown, and the application is running as intended. When you run the application, it randomly opens a empty chromium tab along side the application. The tab serves no purpose.
I have also tested this on other machines, and get the same result.
No I'm not calling CefShutdown
You need to call CefShutdown (or CefSharp equivalent) for proper shutdown. That is likely why you're getting the popup window with "Chromium didn't shut down correctly".
Sorry for the ignorance but why would I need to call CefShutdown? isn't its purpose to close the application? https://github.com/cefsharp/CefSharp/issues/2487#issuecomment-413501667
The issue i'm encountering happens during the application startup
You can try the --hide-crash-restore-bubble
command-line flag, or setting CefSettings.persist_session_cookies to false.
This is related to prefs::kRestoreOnStartup
which is configured here in CEF. A value of SessionStartupPref::kPrefValueLast
will cause ShouldRestoreLastSession
to return true in SessionService::ShouldRestore.
Sorry for the ignorance but why would I need to call CefShutdown? The issue i'm encountering happens during the application startup
This issue is likely occurring because your previous application run did not shut down CEF/Chromium properly. From your link it sounds like CefSharp may call CefShutdown for you. I suggest you explore why that might not be occurring in your case. For example, maybe your application is crashing during shutdown.
@magreenblatt Thank you so much! that worked. You are correct the issue was with the closing of the app and the command line flag helped.
@magreenblatt I encountered a similar problem In the cef_binary_128.4.9+g9840ad9+chromium-128.0.6613.120_windows64. My Win32 program needs to enable persist_session_cookies
to save some tokens. Whether or not I add --hide-crash-restore-bubble
to the command line flag, the program will pop up the page where it exited abnormally before. My application does call CefShutdown, but we cannot always expect the program have executed CefShutdown , such as killing processes from the task manager or the other processes. Now we can just disable persist_session_cookies
to solve this problem, but I think we need a switch to individually control whether the infinite recovery function is enabled or not. Or our application can handle whenever to restore these sessions?
Issue
I have a WPF application using Cefsharp 126.2.70. The changes from the 126.2.70 changes the cefsettings runtime to chrome. The ChromeRuntime bootstrap opens a random chrome tab when the WPF window is loaded. This does not happen every time but it happens on every other try of opening the application. Below the what the tab looks like:
Reproduce
Expected Behavior
Versions
Code Example
App.xaml.cd ` private void Application_Startup(object sender, StartupEventArgs e) { var settings = new CefSettings() { // ChromeRuntime = false, LogFile = "Debug.log", LogSeverity = LogSeverity.Verbose, CachePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\Cache"), };
`
MainWindow.xaml.cd ` public MainWindow() { InitializeComponent();
} `