use shared commands

This commit is contained in:
Jeremy Wu
2019-08-06 21:58:46 +10:00
parent a3770a8947
commit 7d9e848edb
2 changed files with 5 additions and 13 deletions

View File

@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Controls;
using Wox.Infrastructure.Storage;
using Wox.Plugin.SharedCommands;
namespace Wox.Plugin.Url
{
@@ -80,15 +79,8 @@ namespace Wox.Plugin.Url
}
try
{
var browserExecutableName = _settings.BrowserPath?.Split(new[] { System.IO.Path.DirectorySeparatorChar }, StringSplitOptions.None).Last();
var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : _settings.BrowserPath;
raw.NewBrowserWindow(_settings.BrowserPath);
// 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(browser, browserArguements);
return true;
}
catch(Exception ex)