Add option to open in tab for WebSearch plugin

This commit is contained in:
Jeremy Wu
2019-11-10 19:12:43 +11:00
parent 93c952b344
commit 2debabe664
3 changed files with 42 additions and 5 deletions

View File

@@ -74,7 +74,14 @@ namespace Wox.Plugin.WebSearch
IcoPath = searchSource.IconPath,
Action = c =>
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)).NewBrowserWindow("");
if (_settings.OpenInNewBrowser)
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)).NewBrowserWindow("");
}
else
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)).NewTabInBrowser("");
}
return true;
}
@@ -132,7 +139,15 @@ namespace Wox.Plugin.WebSearch
IcoPath = searchSource.IconPath,
Action = c =>
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)).NewBrowserWindow("");
if (_settings.OpenInNewBrowser)
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)).NewBrowserWindow("");
}
else
{
searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)).NewTabInBrowser("");
}
return true;
}
});

View File

@@ -219,5 +219,7 @@ namespace Wox.Plugin.WebSearch
}
}
}
public bool OpenInNewBrowser { get; set; } = true;
}
}