Fix Process.Start on URL

This commit is contained in:
Jeremy Wu 2020-04-23 20:10:20 +10:00
parent 4114000293
commit 13217d1e72
3 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@ using System.Windows.Documents;
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin.SharedCommands;
namespace Flow.Launcher
{
@ -51,8 +52,8 @@ namespace Flow.Launcher
var link = new Hyperlink { IsEnabled = true };
link.Inlines.Add(url);
link.NavigateUri = new Uri(url);
link.RequestNavigate += (s, e) => Process.Start(e.Uri.ToString());
link.Click += (s, e) => Process.Start(url);
link.RequestNavigate += (s, e) => SearchWeb.NewBrowserWindow(e.Uri.ToString());
link.Click += (s, e) => SearchWeb.NewBrowserWindow(url);
paragraph.Inlines.Add(textBeforeUrl);
paragraph.Inlines.Add(link);

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
@ -229,7 +229,7 @@ namespace Flow.Launcher
var uri = new Uri(website);
if (Uri.CheckSchemeName(uri.Scheme))
{
Process.Start(website);
SearchWeb.NewBrowserWindow(website);
}
}
}

View file

@ -17,6 +17,7 @@ using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Storage;
namespace Flow.Launcher.ViewModel
@ -130,7 +131,7 @@ namespace Flow.Launcher.ViewModel
StartHelpCommand = new RelayCommand(_ =>
{
Process.Start("http://doc.wox.one/");
SearchWeb.NewBrowserWindow("http://doc.wox.one/");
});
OpenResultCommand = new RelayCommand(index =>