mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Support application uri
This commit is contained in:
parent
b9048f50f0
commit
32107dbece
2 changed files with 22 additions and 13 deletions
|
|
@ -60,7 +60,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Process.Start(psi);
|
Process.Start(psi)?.Dispose();
|
||||||
}
|
}
|
||||||
catch (System.ComponentModel.Win32Exception)
|
catch (System.ComponentModel.Win32Exception)
|
||||||
{
|
{
|
||||||
|
|
@ -100,7 +100,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
||||||
psi.FileName = url;
|
psi.FileName = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
Process.Start(psi);
|
Process.Start(psi)?.Dispose();
|
||||||
}
|
}
|
||||||
// This error may be thrown if browser path is incorrect
|
// This error may be thrown if browser path is incorrect
|
||||||
catch (System.ComponentModel.Win32Exception)
|
catch (System.ComponentModel.Win32Exception)
|
||||||
|
|
|
||||||
|
|
@ -211,19 +211,28 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
public void OpenUrl(string url, bool? inPrivate = null)
|
public void OpenUrl(string url, bool? inPrivate = null)
|
||||||
{
|
{
|
||||||
var browserInfo = _settingsVM.Settings.CustomBrowser;
|
var uri = new Uri(url);
|
||||||
|
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
|
||||||
var path = browserInfo.Path == "*" ? "" : browserInfo.Path;
|
|
||||||
|
|
||||||
if (browserInfo.OpenInTab)
|
|
||||||
{
|
{
|
||||||
url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
|
var browserInfo = _settingsVM.Settings.CustomBrowser;
|
||||||
}
|
|
||||||
else
|
var path = browserInfo.Path == "*" ? "" : browserInfo.Path;
|
||||||
{
|
|
||||||
url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
|
if (browserInfo.OpenInTab)
|
||||||
|
{
|
||||||
|
url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process.Start(new ProcessStartInfo()
|
||||||
|
{
|
||||||
|
FileName = url, UseShellExecute = true
|
||||||
|
})?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
||||||
|
|
@ -254,4 +263,4 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue