[PT Run] Web search should use user's default browser (#17304)

* Web search does not use my default browser #16549
updated DefaultBrowserInfo logic to get program location from shell open command not icon location

* Refactored DefaultBrowserInfo to start default browser with arguments specified in shell/open/command value for the browser.
Added fallback to Microsoft Edge if no browser information available.
#16549 Web search does not use my default browser

* fixed comment
#16549 Web search does not use my default browser
This commit is contained in:
lncubus
2022-04-12 17:10:05 +02:00
committed by GitHub
parent f778d010e5
commit 86783e9815
3 changed files with 85 additions and 151 deletions

View File

@@ -148,6 +148,16 @@ namespace Wox.Infrastructure
return Process.Start(processStartInfo);
}
public static bool OpenCommandInShell(string path, string pattern, string arguments, string workingDir = null, ShellRunAsType runAs = ShellRunAsType.None, bool runWithHiddenWindow = false)
{
if (pattern.Contains("%1", StringComparison.Ordinal))
{
arguments = pattern.Replace("%1", arguments);
}
return OpenInShell(path, arguments, workingDir, runAs, runWithHiddenWindow);
}
public static bool OpenInShell(string path, string arguments = null, string workingDir = null, ShellRunAsType runAs = ShellRunAsType.None, bool runWithHiddenWindow = false)
{
using (var process = new Process())