add backwards compatibility for open in new browser tab/window

This commit is contained in:
Jeremy 2021-12-08 21:49:14 +11:00
parent 932dea0ed3
commit af2277de61
2 changed files with 16 additions and 4 deletions

View file

@ -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.
/// </summary>
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);
}
/// <summary>
/// Opens search as a tab in the default browser chosen in Windows settings.
/// </summary>
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);
}
}
}

View file

@ -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);
}
}