From af2277de613f9ae7b140cfcd27e897f9f3f5ac04 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Dec 2021 21:49:14 +1100 Subject: [PATCH] add backwards compatibility for open in new browser tab/window --- Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | 16 ++++++++++++++-- Flow.Launcher/PublicAPIInstance.cs | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index fd1841dda..bd0c620e9 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -35,7 +35,7 @@ namespace Flow.Launcher.Plugin.SharedCommands /// Opens search in a new browser. If no browser path is passed in then Chrome is used. /// Leave browser path blank to use Chrome. /// - public static void NewBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") + public static void OpenInBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; @@ -71,10 +71,16 @@ namespace Flow.Launcher.Plugin.SharedCommands } } + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewBrowserWindow(this string url, string browserPath = "") + { + OpenInBrowserWindow(url, browserPath); + } + /// /// Opens search as a tab in the default browser chosen in Windows settings. /// - public static void NewTabInBrowser(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") + public static void OpenInBrowserTab(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; @@ -105,5 +111,11 @@ namespace Flow.Launcher.Plugin.SharedCommands }); } } + + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewTabInBrowser(this string url, string browserPath = "") + { + OpenInBrowserTab(url, browserPath); + } } } \ No newline at end of file diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 238a57cbc..46f192a91 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -217,10 +217,10 @@ namespace Flow.Launcher if (browserInfo.OpenInTab) { - url.NewTabInBrowser(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); + url.OpenInBrowserTab(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); }else { - url.NewBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); + url.OpenInBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); } }