Skip to content

Commit

Permalink
==
Browse files Browse the repository at this point in the history
  • Loading branch information
yhnbgfd committed Dec 11, 2024
1 parent 74d5b74 commit cb80e74
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions MultiOpenBrowser.Core/Base/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static Global()
builder.RegisterType<Chrome>().Keyed<WebBrowserBase>(TypeEnum.Chrome);
builder.RegisterType<MsEdge>().Keyed<WebBrowserBase>(TypeEnum.MsEdge);
builder.RegisterType<Firefox>().Keyed<WebBrowserBase>(TypeEnum.Firefox);
builder.RegisterType<Browser360>().Keyed<WebBrowserBase>(TypeEnum.Browser360);
builder.RegisterType<CustomizeBrowser>().Keyed<WebBrowserBase>(TypeEnum.Other);
Container = builder.Build();
}
Expand Down
4 changes: 2 additions & 2 deletions MultiOpenBrowser.Core/WebBrowsers/Browser360.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class Browser360(WebEnvironment webEnvironment) : WebBrowserBase(webEnv
// 360浏览器特有的一些参数
sb.Append("--360browser ");
sb.Append("--no-sandbox ");

if (_webEnvironment.WebBrowser.DisableWebSecurity)
{
sb.Append("--disable-web-security ");
Expand Down Expand Up @@ -67,4 +67,4 @@ public override StartResult Start(StartOption startOption)
return StartResult.SuccessResult(process.Id);
}
}
}
}
9 changes: 3 additions & 6 deletions MultiOpenBrowser/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ private async void Application_Startup(object sender, StartupEventArgs e)

private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString(), "DispatcherUnhandledException");
MessageBox.Show(e.Exception.ToString(), "DispatcherUnhandledException", MessageBoxButton.OK, MessageBoxImage.Error);
e.Handled = true;
//Environment.Exit(1);
}

private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString(), "UnhandledException");
//Environment.Exit(1);
MessageBox.Show(e.Exception.ToString(), "UnhandledException", MessageBoxButton.OK, MessageBoxImage.Error);
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show((e.ExceptionObject as Exception)?.ToString(), "UnobservedTaskException");
//Environment.Exit(1);
MessageBox.Show((e.ExceptionObject as Exception)?.ToString(), "UnobservedTaskException", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void Button_StartWebEnvironment_Click(object sender, RoutedEventArgs e)
catch (Exception ex)
{
_logger.Error(ex);
MessageBox.Show(Application.Current.MainWindow, ex.Message);
MessageBox.Show(Application.Current.MainWindow, ex.Message, "Start WebEnvironment Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}

Expand All @@ -59,7 +59,7 @@ private async void Button_DeleteWebEnvironment_Click(object sender, RoutedEventA
return;
}

var result = MessageBox.Show(Application.Current.MainWindow, "Delete WebEnvironment ?", "Delete WebEnvironment", MessageBoxButton.OKCancel);
var result = MessageBox.Show(Application.Current.MainWindow, "Delete WebEnvironment ?", "Delete WebEnvironment", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
if (result == MessageBoxResult.Cancel)
{
return;
Expand Down Expand Up @@ -88,7 +88,7 @@ private async void Button_DeleteWebEnvironment_Click(object sender, RoutedEventA
{
uow.Rollback();
_logger.Error(ex);
MessageBox.Show(Application.Current.MainWindow, ex.Message);
MessageBox.Show(Application.Current.MainWindow, ex.Message, "Delete WebEnvironment Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
finally
{
Expand Down Expand Up @@ -131,7 +131,7 @@ private void Button_StartWebEnvironmentIncognito_Click(object sender, RoutedEven
catch (Exception ex)
{
_logger.Error(ex);
MessageBox.Show(Application.Current.MainWindow, ex.Message);
MessageBox.Show(Application.Current.MainWindow, ex.Message, "Start WebEnvironment Incognito Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}

Expand Down Expand Up @@ -202,7 +202,7 @@ private void MenuItem_CopyStartupCMD_Click(object sender, RoutedEventArgs e)
catch (Exception ex)
{
_logger.Error(ex);
MessageBox.Show(Application.Current.MainWindow, ex.Message);
MessageBox.Show(Application.Current.MainWindow, ex.Message, "Copy Startup CMD Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private async void Button_Save_Click(object sender, RoutedEventArgs e)
{
uow.Rollback();
_logger.Error(ex);
MessageBox.Show(Application.Current.MainWindow, ex.Message);
MessageBox.Show(Application.Current.MainWindow, ex.Message, "Save WebEnvironment Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}

Expand Down

0 comments on commit cb80e74

Please sign in to comment.