mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 03:59:15 +08:00
Reverse changes made to new browser window call
This commit is contained in:
parent
b565d1ab76
commit
3e292d7604
@ -11,18 +11,25 @@ namespace Wox.Plugin.SharedCommands
|
|||||||
/// Opens search in a new browser. If no browser path is passed in then Chrome is used.
|
/// Opens search in a new browser. If no browser path is passed in then Chrome is used.
|
||||||
/// Leave browser path blank to use Chrome.
|
/// Leave browser path blank to use Chrome.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void NewBrowserWindow(this string url, string browserPath)
|
public static void NewBrowserWindow(this string url, string browserPath)
|
||||||
{
|
{
|
||||||
var browserExecutableName = browserPath?
|
var browserExecutableName = browserPath?
|
||||||
.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None)
|
.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None)
|
||||||
.Last();
|
.Last();
|
||||||
|
|
||||||
var selectedBrowserPath = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath;
|
var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath;
|
||||||
|
|
||||||
// Internet Explorer will open url in new browser window, and does not take the --new-window parameter
|
// Internet Explorer will open url in new browser window, and does not take the --new-window parameter
|
||||||
var browserArguements = browserExecutableName == "iexplore.exe" ? "" : "--new-window ";
|
var browserArguements = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url;
|
||||||
|
|
||||||
OpenWebSearch(selectedBrowserPath, browserArguements, url);
|
try
|
||||||
|
{
|
||||||
|
Process.Start(browser, browserArguements);
|
||||||
|
}
|
||||||
|
catch (System.ComponentModel.Win32Exception)
|
||||||
|
{
|
||||||
|
Process.Start(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user