diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 133ad25a5..986710ab8 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -231,5 +231,10 @@ namespace Flow.Launcher.Plugin /// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings. /// public void OpenUrl(string url, bool? inPrivate = null); + + /// + /// Opens the application URI. + /// + public void OpenAppUri(string appUri); } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 20d1b8de2..f22eb73c0 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -209,7 +209,7 @@ namespace Flow.Launcher explorer.Start(); } - public void OpenUrl(string url, bool? inPrivate = null) + public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false) { var uri = new Uri(url); if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) @@ -229,10 +229,28 @@ namespace Flow.Launcher return; } - Process.Start(new ProcessStartInfo() + if (isAppUri) { - FileName = url, UseShellExecute = true - })?.Dispose(); + Process.Start(new ProcessStartInfo() + { + FileName = url, + UseShellExecute = true + })?.Dispose(); + + return; + } + + throw new InvalidOperationException("URI scheme not specifiedor supported "); + } + + public void OpenUrl(string url, bool? inPrivate = null) + { + OpenUri(url, inPrivate); + } + + public void OpenAppUri(string appUri) + { + OpenUri(appUri, isAppUri: true); } public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;