mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Browser crash message, mutual friends message
This commit is contained in:
@@ -69,28 +69,17 @@ namespace VRCX
|
||||
public void OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status,
|
||||
int errorCode, string errorMessage)
|
||||
{
|
||||
switch (status)
|
||||
var message = status switch
|
||||
{
|
||||
case CefTerminationStatus.AbnormalTermination:
|
||||
_logger.Error("Browser terminated abnormally.");
|
||||
break;
|
||||
|
||||
case CefTerminationStatus.ProcessWasKilled:
|
||||
_logger.Error("Browser was killed.");
|
||||
break;
|
||||
|
||||
case CefTerminationStatus.ProcessCrashed:
|
||||
_logger.Error("Browser crashed.");
|
||||
break;
|
||||
|
||||
case CefTerminationStatus.OutOfMemory:
|
||||
_logger.Error("Browser out of memory.");
|
||||
break;
|
||||
|
||||
default:
|
||||
_logger.Error($"Browser terminated with unhandled status '{status}' while at address.");
|
||||
break;
|
||||
}
|
||||
CefTerminationStatus.AbnormalTermination => "Browser terminated abnormally.",
|
||||
CefTerminationStatus.ProcessWasKilled => "Browser was killed.",
|
||||
CefTerminationStatus.ProcessCrashed => "Browser crashed.",
|
||||
CefTerminationStatus.OutOfMemory => "Browser out of memory.",
|
||||
_ => $"Browser terminated with unhandled status code '{status}'"
|
||||
};
|
||||
_logger.Error("Render process terminated: {Message} ErrorCode: {ErrorCode} ErrorMessage: {ErrorMessage}",
|
||||
message, errorCode, errorMessage);
|
||||
StartupArgs.LaunchArguments.LaunchCommand = $"crash/{message}";
|
||||
|
||||
if (chromiumWebBrowser.IsDisposed || chromiumWebBrowser.IsLoading)
|
||||
return;
|
||||
|
||||
23
Dotnet/Cef/MainForm.Designer.cs
generated
23
Dotnet/Cef/MainForm.Designer.cs
generated
@@ -43,6 +43,7 @@ namespace VRCX
|
||||
this.TrayMenu = new ContextMenuStrip(this.components);
|
||||
this.TrayMenu_Open = new ToolStripMenuItem();
|
||||
this.TrayMenu_DevTools = new ToolStripMenuItem();
|
||||
this.TrayMenu_ForceCrash = new ToolStripMenuItem();
|
||||
this.TrayMenu_Separator = new ToolStripSeparator();
|
||||
this.TrayMenu_Quit = new ToolStripMenuItem();
|
||||
this.TrayIcon = new NotifyIcon(this.components);
|
||||
@@ -53,13 +54,13 @@ namespace VRCX
|
||||
//
|
||||
// TrayMenu
|
||||
//
|
||||
this.TrayMenu.Items.AddRange(new ToolStripItem[]
|
||||
{
|
||||
this.TrayMenu_Open,
|
||||
this.TrayMenu_DevTools,
|
||||
this.TrayMenu_Separator,
|
||||
this.TrayMenu_Quit
|
||||
});
|
||||
this.TrayMenu.Items.Add(this.TrayMenu_Open);
|
||||
this.TrayMenu.Items.Add(this.TrayMenu_DevTools);
|
||||
if (Program.LaunchDebug)
|
||||
this.TrayMenu.Items.Add(this.TrayMenu_ForceCrash);
|
||||
this.TrayMenu.Items.Add(this.TrayMenu_Separator);
|
||||
this.TrayMenu.Items.Add(this.TrayMenu_Quit);
|
||||
|
||||
this.TrayMenu.Name = "TrayMenu";
|
||||
this.TrayMenu.Size = new Size(132, 54);
|
||||
//
|
||||
@@ -77,6 +78,13 @@ namespace VRCX
|
||||
this.TrayMenu_DevTools.Text = "DevTools";
|
||||
this.TrayMenu_DevTools.Click += new EventHandler(this.TrayMenu_DevTools_Click);
|
||||
//
|
||||
// TrayMenu_ForceCrash
|
||||
//
|
||||
this.TrayMenu_ForceCrash.Name = "TrayMenu_ForceCrash";
|
||||
this.TrayMenu_ForceCrash.Size = new Size(131, 22);
|
||||
this.TrayMenu_ForceCrash.Text = "Force Crash";
|
||||
this.TrayMenu_ForceCrash.Click += new EventHandler(this.TrayMenu_ForceCrash_Click);
|
||||
//
|
||||
// TrayMenu_Separator
|
||||
//
|
||||
this.TrayMenu_Separator.Name = "TrayMenu_Separator";
|
||||
@@ -119,6 +127,7 @@ namespace VRCX
|
||||
private ContextMenuStrip TrayMenu;
|
||||
private ToolStripMenuItem TrayMenu_Open;
|
||||
private ToolStripMenuItem TrayMenu_DevTools;
|
||||
private ToolStripMenuItem TrayMenu_ForceCrash;
|
||||
private ToolStripSeparator TrayMenu_Separator;
|
||||
private ToolStripMenuItem TrayMenu_Quit;
|
||||
private NotifyIcon TrayIcon;
|
||||
|
||||
@@ -243,6 +243,11 @@ namespace VRCX
|
||||
{
|
||||
Instance.Browser.ShowDevTools();
|
||||
}
|
||||
|
||||
private void TrayMenu_ForceCrash_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Instance.Browser.LoadUrl("chrome://crash");
|
||||
}
|
||||
|
||||
private void TrayMenu_Quit_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user