mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Bugfix and update
Fix bug when no browser path specified will be null instead of .Length == 0. Add open url in new browser window by default
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using Wox.Infrastructure.Storage;
|
using Wox.Infrastructure.Storage;
|
||||||
@@ -79,14 +80,14 @@ namespace Wox.Plugin.Url
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_settings.BrowserPath.Length == 0)
|
var browserExecutableName = _settings.BrowserPath?.Split(new[] { System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.None).Last();
|
||||||
{
|
|
||||||
Process.Start(raw);
|
var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : _settings.BrowserPath;
|
||||||
}
|
|
||||||
else
|
// Internet Explorer will open url in new browser window, and does not take the --new-window parameter
|
||||||
{
|
var browserArguements = browserExecutableName == "iexplore.exe" ? raw : "--new-window " + raw;
|
||||||
Process.Start(_settings.BrowserPath,"--new-window" + raw);
|
|
||||||
}
|
Process.Start(browser, browserArguements);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user