diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Images/copylink.png b/Plugins/Flow.Launcher.Plugin.WebSearch/Images/copylink.png
new file mode 100644
index 000000000..3218c94c9
Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.WebSearch/Images/copylink.png differ
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml
index db42aa7fc..72f618f55 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml
@@ -31,7 +31,8 @@
Thus, the generic formula for a search on Netflix is https://www.netflix.com/search?q={q}
-
+ Copy URL
+ Copy search URL to clipboard
Title
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml
index a2ec9405a..b8757f67b 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/ru.xaml
@@ -29,7 +29,8 @@
Thus, the generic formula for a search on Netflix is https://www.netflix.com/search?q={q}
-
+ Скопировать URL-адрес
+ Скопировать URL поиска в буфер обмена
Title
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs
index 39aa1738f..9b3dd06f5 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs
@@ -11,7 +11,7 @@ using Flow.Launcher.Plugin.SharedCommands;
namespace Flow.Launcher.Plugin.WebSearch
{
- public class Main : IAsyncPlugin, ISettingProvider, IPluginI18n, IResultUpdated
+ public class Main : IAsyncPlugin, ISettingProvider, IPluginI18n, IResultUpdated, IContextMenu
{
private PluginInitContext _context;
@@ -76,7 +76,8 @@ namespace Flow.Launcher.Plugin.WebSearch
_context.API.OpenUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)));
return true;
- }
+ },
+ ContextData = searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)),
};
results.Add(result);
@@ -139,11 +140,30 @@ namespace Flow.Launcher.Plugin.WebSearch
_context.API.OpenUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)));
return true;
- }
+ },
+ ContextData = searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)),
});
return resultsFromSuggestion;
}
+ public List LoadContextMenus(Result selected)
+ {
+ return new List() {
+ new Result
+ {
+ Title = _context.API.GetTranslation("flowlauncher_plugin_websearch_copyurl_title"),
+ SubTitle = _context.API.GetTranslation("flowlauncher_plugin_websearch_copyurl_subtitle"),
+ IcoPath = "Images/copylink.png",
+ Action = c =>
+ {
+ _context.API.CopyToClipboard(selected.ContextData as string);
+
+ return true;
+ }
+ },
+ };
+ }
+
public Task InitAsync(PluginInitContext context)
{
return Task.Run(Init);