Skip to content

Commit af2277d

Browse files
committed
add backwards compatibility for open in new browser tab/window
1 parent 932dea0 commit af2277d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private static string GetDefaultBrowserPath()
3535
/// Opens search in a new browser. If no browser path is passed in then Chrome is used.
3636
/// Leave browser path blank to use Chrome.
3737
/// </summary>
38-
public static void NewBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "")
38+
public static void OpenInBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "")
3939
{
4040
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;
4141

@@ -71,10 +71,16 @@ public static void NewBrowserWindow(this string url, string browserPath = "", bo
7171
}
7272
}
7373

74+
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
75+
public static void NewBrowserWindow(this string url, string browserPath = "")
76+
{
77+
OpenInBrowserWindow(url, browserPath);
78+
}
79+
7480
/// <summary>
7581
/// Opens search as a tab in the default browser chosen in Windows settings.
7682
/// </summary>
77-
public static void NewTabInBrowser(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "")
83+
public static void OpenInBrowserTab(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "")
7884
{
7985
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;
8086

@@ -105,5 +111,11 @@ public static void NewTabInBrowser(this string url, string browserPath = "", boo
105111
});
106112
}
107113
}
114+
115+
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
116+
public static void NewTabInBrowser(this string url, string browserPath = "")
117+
{
118+
OpenInBrowserTab(url, browserPath);
119+
}
108120
}
109121
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ public void OpenUrl(string url)
217217

218218
if (browserInfo.OpenInTab)
219219
{
220-
url.NewTabInBrowser(path, browserInfo.EnablePrivate, browserInfo.PrivateArg);
220+
url.OpenInBrowserTab(path, browserInfo.EnablePrivate, browserInfo.PrivateArg);
221221
}else
222222
{
223-
url.NewBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg);
223+
url.OpenInBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg);
224224
}
225225

226226
}

0 commit comments

Comments
 (0)