From 78af09acff7d4745de5c84baaadc4a36ccd4dfb3 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 8 Nov 2021 11:11:25 +0900 Subject: [PATCH 01/39] Add Browser Item Area --- Flow.Launcher/SettingWindow.xaml | 41 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index c567812f8..fa2bb1acc 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -681,10 +681,7 @@ - + + +  + + + + + + + + + + + + Date: Mon, 8 Nov 2021 18:40:20 +0900 Subject: [PATCH 02/39] Add Browser Setting Popup --- Flow.Launcher/Languages/en.xaml | 12 ++ Flow.Launcher/SelectBrowserWindow.xaml | 214 ++++++++++++++++++++++ Flow.Launcher/SelectBrowserWindow.xaml.cs | 45 +++++ Flow.Launcher/SettingWindow.xaml | 143 ++++++++------- Flow.Launcher/SettingWindow.xaml.cs | 6 + 5 files changed, 349 insertions(+), 71 deletions(-) create mode 100644 Flow.Launcher/SelectBrowserWindow.xaml create mode 100644 Flow.Launcher/SelectBrowserWindow.xaml.cs diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 289aec337..6c3fbe777 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -36,6 +36,8 @@ Disable Flow Launcher activation when a full screen application is active (Recommended for games). Default File Manager Select the file manager to use when opening the folder. + Default Web Browser + Setting for New Tab, New Window, Private Mode. Python Directory Auto Update Select @@ -145,6 +147,16 @@ Arguments For Folder Arguments For File + + Default Web Browser + The default setting follows the OS default browser setting. If specified separately, flow uses that browser. + Browser + Browser Name + Browser Path + New Window + New Tab + Priviate Mode + Change Priority Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml new file mode 100644 index 000000000..9a435c996 --- /dev/null +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/SelectBrowserWindow.xaml.cs b/Flow.Launcher/SelectBrowserWindow.xaml.cs new file mode 100644 index 000000000..1f79b463b --- /dev/null +++ b/Flow.Launcher/SelectBrowserWindow.xaml.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Flow.Launcher +{ + /// + /// SelectBrowserWindow.xaml에 대한 상호 작용 논리 + /// + public partial class SelectBrowserWindow : Window + { + public SelectBrowserWindow() + { + InitializeComponent(); + } + + private void btnCancel_Click(object sender, RoutedEventArgs e) + { + } + + private void btnDone_Click(object sender, RoutedEventArgs e) + { + } + + private void btnAdd_Click(object sender, RoutedEventArgs e) + { + } + + private void btnDelete_Click(object sender, RoutedEventArgs e) + { + } + } + + +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 761dec1d7..7ef751df3 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -688,78 +688,79 @@ - - - - - - - - - - -  - - - - - - - - - - - - - -  - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml index 1ee02fa43..6762ca345 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml @@ -10,71 +10,12 @@ mc:Ignorable="d"> - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - New Tab - New Window - - - + + + + + + + + + + + + + + + + + + + + New Tab + New Window + + + + + + + - - - - + + + + + + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 8c7b34e9c..11d48235e 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -52,9 +52,15 @@ - + - + @@ -90,7 +96,10 @@ - - @@ -241,19 +253,21 @@ - - + + @@ -311,19 +325,21 @@ - - + + @@ -796,38 +812,35 @@ Content="{Binding Settings.CustomExplorer.Name}" /> - -  - - - - - - - - - - - - + ForceCursor="True" + Style="{DynamicResource AccentButtonStyle}" /> From 40d7baac86f02cb8c62b88bd4ccc806004f1ce13 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 7 Dec 2021 19:33:11 +0900 Subject: [PATCH 18/39] Add Chrome, Edge, Firefox Browser Profile --- .../UserSettings/Settings.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 2bbed1f3b..0d39d6663 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -104,6 +104,31 @@ namespace Flow.Launcher.Infrastructure.UserSettings PrivateArg = "", EnablePrivate = false, Editable = false + }, + new() + { + Name = "Google Chrome", + Path = "chrome", + PrivateArg = "-incognito", + EnablePrivate = false, + Editable = false + }, + new() + { + Name = "Mozilla Firefox", + Path = "firefox", + PrivateArg = "-private", + EnablePrivate = false, + Editable = false + } + , + new() + { + Name = "MS Edge", + Path = "msedge", + PrivateArg = "-inprivate", + EnablePrivate = false, + Editable = false } }; From ba2853b5c19055c02ac399005dde1b21cf1ea8cd Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 7 Dec 2021 19:40:01 +0900 Subject: [PATCH 19/39] Fix Edge Private arg --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 0d39d6663..8ecd6dc4b 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -126,7 +126,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings { Name = "MS Edge", Path = "msedge", - PrivateArg = "-inprivate", + PrivateArg = "-inPrivate", EnablePrivate = false, Editable = false } From b2867620626decdf854289fa3e89f88355046a1c Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:21:03 -0600 Subject: [PATCH 20/39] Update Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs Co-authored-by: Jeremy Wu --- Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs index d2af6eb6d..c50fea52e 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml.cs @@ -21,7 +21,6 @@ namespace Flow.Launcher.Plugin.WebSearch _context = context; _settings = viewModel.Settings; DataContext = viewModel; - } private void OnAddSearchSearchClick(object sender, RoutedEventArgs e) From 8ba52ff2446f7a2de174e0fd0944c0ad6e8d4e86 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:21:14 -0600 Subject: [PATCH 21/39] Update Flow.Launcher/SettingWindow.xaml.cs Co-authored-by: Jeremy Wu --- Flow.Launcher/SettingWindow.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 30e00da3c..ca5f28855 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -122,8 +122,8 @@ namespace Flow.Launcher private void OnSelectDefaultBrowserClick(object sender, RoutedEventArgs e) { - SelectBrowserWindow test = new SelectBrowserWindow(settings); - test.ShowDialog(); + var browserWindow = new SelectBrowserWindow(settings); + browserWindow.ShowDialog(); } #endregion From 127888137bfab26c151bc6b5bed1d47e04796b6a Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:21:37 -0600 Subject: [PATCH 22/39] Update Flow.Launcher/SelectBrowserWindow.xaml.cs Co-authored-by: Jeremy Wu --- Flow.Launcher/SelectBrowserWindow.xaml.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Flow.Launcher/SelectBrowserWindow.xaml.cs b/Flow.Launcher/SelectBrowserWindow.xaml.cs index 32d79e569..5ab888527 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml.cs +++ b/Flow.Launcher/SelectBrowserWindow.xaml.cs @@ -18,9 +18,6 @@ using System.Windows.Shapes; namespace Flow.Launcher { - /// - /// SelectBrowserWindow.xaml에 대한 상호 작용 논리 - /// public partial class SelectBrowserWindow : Window, INotifyPropertyChanged { private int selectedCustomExplorerIndex; From 171a5015db8c1e8301e2b8bbac53dff0044244db Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:21:44 -0600 Subject: [PATCH 23/39] Update Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs Co-authored-by: Jeremy Wu --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index a07071d1e..f87ca3969 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -213,7 +213,6 @@ namespace Flow.Launcher.Plugin /// Extra FileName Info public void OpenDirectory(string DirectoryPath, string FileName = null); - public void OpenUrl(string url); } } From d2bb1e88e507997eb9a3756ac7b261bca6177ae2 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:22:23 -0600 Subject: [PATCH 24/39] Update Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs Co-authored-by: Jeremy Wu --- .../UserSettings/CustomBrowserViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs index 7ce1dd656..1cf62873c 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs @@ -25,7 +25,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings } } - } From 233a3382961965c4a5152a28919d535a34b6eb87 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:22:34 -0600 Subject: [PATCH 25/39] Update Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs Co-authored-by: Jeremy Wu --- .../UserSettings/CustomBrowserViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs index 1cf62873c..30b7c5a68 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs @@ -23,7 +23,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings Editable = Editable }; } - } } From cbd23373c300205fb14fa1dca07a45c91df401d1 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Tue, 7 Dec 2021 23:24:15 -0600 Subject: [PATCH 26/39] Update Flow.Launcher/PublicAPIInstance.cs Co-authored-by: Jeremy Wu --- Flow.Launcher/PublicAPIInstance.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 606143bff..238a57cbc 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -211,7 +211,6 @@ namespace Flow.Launcher public void OpenUrl(string url) { - using var process = new Process(); var browserInfo = _settingsVM.Settings.CustomBrowser; var path = browserInfo.Path == "*" ? "" : browserInfo.Path; From d9529508941f60d5debe591e391d49ce543d4e5f Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 8 Dec 2021 17:56:06 +0900 Subject: [PATCH 27/39] remove comment --- .../Views/CustomBrowserSetting.xaml | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml index 5b3478050..8a2a65f26 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml @@ -126,67 +126,5 @@ - From 932dea0ed3e29945a0d9642e47a37174cc369b16 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 8 Dec 2021 18:27:26 +0900 Subject: [PATCH 28/39] Add Checkbox disable when no private arg --- Flow.Launcher/SelectBrowserWindow.xaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml index 22b5c8e98..85083fa50 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -222,7 +222,17 @@ + IsChecked="{Binding EnablePrivate}"> + + + + From af2277de613f9ae7b140cfcd27e897f9f3f5ac04 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Dec 2021 21:49:14 +1100 Subject: [PATCH 29/39] add backwards compatibility for open in new browser tab/window --- Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | 16 ++++++++++++++-- Flow.Launcher/PublicAPIInstance.cs | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index fd1841dda..bd0c620e9 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -35,7 +35,7 @@ namespace Flow.Launcher.Plugin.SharedCommands /// Opens search in a new browser. If no browser path is passed in then Chrome is used. /// Leave browser path blank to use Chrome. /// - public static void NewBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") + public static void OpenInBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; @@ -71,10 +71,16 @@ namespace Flow.Launcher.Plugin.SharedCommands } } + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewBrowserWindow(this string url, string browserPath = "") + { + OpenInBrowserWindow(url, browserPath); + } + /// /// Opens search as a tab in the default browser chosen in Windows settings. /// - public static void NewTabInBrowser(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") + public static void OpenInBrowserTab(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; @@ -105,5 +111,11 @@ namespace Flow.Launcher.Plugin.SharedCommands }); } } + + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewTabInBrowser(this string url, string browserPath = "") + { + OpenInBrowserTab(url, browserPath); + } } } \ No newline at end of file diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 238a57cbc..46f192a91 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -217,10 +217,10 @@ namespace Flow.Launcher if (browserInfo.OpenInTab) { - url.NewTabInBrowser(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); + url.OpenInBrowserTab(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); }else { - url.NewBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); + url.OpenInBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); } } From 05fd41a1047b47e626cfbeef4ef95e7d27c93095 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 8 Dec 2021 10:38:37 -0600 Subject: [PATCH 30/39] fix new tab not save issue --- .../UserSettings/CustomBrowserViewModel.cs | 1 + Flow.Launcher/SelectBrowserWindow.xaml | 6 +++--- Flow.Launcher/SelectBrowserWindow.xaml.cs | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs index 30b7c5a68..83d5b14c9 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs @@ -18,6 +18,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings { Name = Name, Path = Path, + OpenInTab = OpenInTab, PrivateArg = PrivateArg, EnablePrivate = EnablePrivate, Editable = Editable diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml index 85083fa50..594a4325d 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -107,7 +107,7 @@ Margin="10,0,0,0" Click="btnDelete_Click" Content="{DynamicResource delete}" - IsEnabled="{Binding CustomExplorer.Editable}" /> + IsEnabled="{Binding CustomBrowser.Editable}" /> @@ -197,7 +197,7 @@ VerticalAlignment="Center" Orientation="Horizontal"> New Tab - New Window + New Window selectedCustomExplorerIndex; set + get => selectedCustomBrowserIndex; set { - selectedCustomExplorerIndex = value; - PropertyChanged?.Invoke(this, new(nameof(CustomExplorer))); + selectedCustomBrowserIndex = value; + PropertyChanged?.Invoke(this, new(nameof(CustomBrowser))); } } public ObservableCollection CustomBrowsers { get; set; } - public CustomBrowserViewModel CustomExplorer => CustomBrowsers[SelectedCustomBrowserIndex]; + public CustomBrowserViewModel CustomBrowser => CustomBrowsers[SelectedCustomBrowserIndex]; public SelectBrowserWindow(Settings settings) { Settings = settings; @@ -54,7 +54,7 @@ namespace Flow.Launcher { Settings.CustomBrowserList = CustomBrowsers.ToList(); Settings.CustomBrowserIndex = SelectedCustomBrowserIndex; - Close(); + Cl ose(); } private void btnAdd_Click(object sender, RoutedEventArgs e) From 38a9b9a5cb5320895dfd5394ca62dd66ed06344d Mon Sep 17 00:00:00 2001 From: DB P Date: Thu, 9 Dec 2021 02:13:02 +0900 Subject: [PATCH 31/39] Update SelectBrowserWindow.xaml.cs fix close from cl ose --- Flow.Launcher/SelectBrowserWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/SelectBrowserWindow.xaml.cs b/Flow.Launcher/SelectBrowserWindow.xaml.cs index 9013d2756..37f0c47ae 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml.cs +++ b/Flow.Launcher/SelectBrowserWindow.xaml.cs @@ -54,7 +54,7 @@ namespace Flow.Launcher { Settings.CustomBrowserList = CustomBrowsers.ToList(); Settings.CustomBrowserIndex = SelectedCustomBrowserIndex; - Cl ose(); + Close(); } private void btnAdd_Click(object sender, RoutedEventArgs e) From 53f965f1f4e4c89e00dde95bf966aa9a256e36d5 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 8 Dec 2021 17:44:44 -0600 Subject: [PATCH 32/39] remove group to make sure everything static --- Flow.Launcher/SelectBrowserWindow.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SelectBrowserWindow.xaml b/Flow.Launcher/SelectBrowserWindow.xaml index 594a4325d..3f0793c53 100644 --- a/Flow.Launcher/SelectBrowserWindow.xaml +++ b/Flow.Launcher/SelectBrowserWindow.xaml @@ -196,8 +196,8 @@ HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal"> - New Tab - New Window + New Tab + New Window Date: Wed, 8 Dec 2021 17:51:35 -0600 Subject: [PATCH 33/39] ignore openinnewwindow --- .../UserSettings/CustomBrowserViewModel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs index 83d5b14c9..24584115d 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs @@ -1,4 +1,5 @@ using Flow.Launcher.Plugin; +using System.Text.Json.Serialization; namespace Flow.Launcher.Infrastructure.UserSettings { @@ -9,6 +10,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string PrivateArg { get; set; } public bool EnablePrivate { get; set; } public bool OpenInTab { get; set; } = true; + [JsonIgnore] public bool OpenInNewWindow => !OpenInTab; public bool Editable { get; set; } = true; From 721a6580f6036c2e5ed5d3644ed6a3b3c7fb2036 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 8 Dec 2021 19:45:38 -0600 Subject: [PATCH 34/39] Change Space Position for NewWindow --- Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index bd0c620e9..6c4ac8ebf 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -49,7 +49,7 @@ namespace Flow.Launcher.Plugin.SharedCommands var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath; // Internet Explorer will open url in new browser window, and does not take the --new-window parameter - var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : "--new-window ") + (inPrivate ? $" {privateArg}" : "") + url; + var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : "--new-window ") + (inPrivate ? $"{privateArg} " : "") + url; var psi = new ProcessStartInfo { From 13ccd582cee87c4a5b06aabfa01164c0ed7b541c Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 8 Dec 2021 21:06:52 -0600 Subject: [PATCH 35/39] move url before options --- Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index 6c4ac8ebf..a744864da 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -49,7 +49,7 @@ namespace Flow.Launcher.Plugin.SharedCommands var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath; // Internet Explorer will open url in new browser window, and does not take the --new-window parameter - var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : "--new-window ") + (inPrivate ? $"{privateArg} " : "") + url; + var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : url + " --new-window ") + (inPrivate ? $"{privateArg}" : ""); var psi = new ProcessStartInfo { @@ -66,7 +66,8 @@ namespace Flow.Launcher.Plugin.SharedCommands { Process.Start(new ProcessStartInfo { - FileName = url, UseShellExecute = true + FileName = url, + UseShellExecute = true }); } } @@ -93,7 +94,7 @@ namespace Flow.Launcher.Plugin.SharedCommands if (!string.IsNullOrEmpty(browserPath)) { psi.FileName = browserPath; - psi.Arguments = (inPrivate ? $"{privateArg} " : "") + url; + psi.Arguments = url + (inPrivate ? $" {privateArg}" : ""); } else { @@ -107,7 +108,8 @@ namespace Flow.Launcher.Plugin.SharedCommands { Process.Start(new ProcessStartInfo { - FileName = url, UseShellExecute = true + FileName = url, + UseShellExecute = true }); } } From 581e84228ca446304eecb0460589f4ccc23abd6f Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 8 Dec 2021 21:06:52 -0600 Subject: [PATCH 36/39] Revert "move url before options" This reverts commit 13ccd582cee87c4a5b06aabfa01164c0ed7b541c. --- Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index a744864da..6c4ac8ebf 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -49,7 +49,7 @@ namespace Flow.Launcher.Plugin.SharedCommands var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath; // Internet Explorer will open url in new browser window, and does not take the --new-window parameter - var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : url + " --new-window ") + (inPrivate ? $"{privateArg}" : ""); + var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : "--new-window ") + (inPrivate ? $"{privateArg} " : "") + url; var psi = new ProcessStartInfo { @@ -66,8 +66,7 @@ namespace Flow.Launcher.Plugin.SharedCommands { Process.Start(new ProcessStartInfo { - FileName = url, - UseShellExecute = true + FileName = url, UseShellExecute = true }); } } @@ -94,7 +93,7 @@ namespace Flow.Launcher.Plugin.SharedCommands if (!string.IsNullOrEmpty(browserPath)) { psi.FileName = browserPath; - psi.Arguments = url + (inPrivate ? $" {privateArg}" : ""); + psi.Arguments = (inPrivate ? $"{privateArg} " : "") + url; } else { @@ -108,8 +107,7 @@ namespace Flow.Launcher.Plugin.SharedCommands { Process.Start(new ProcessStartInfo { - FileName = url, - UseShellExecute = true + FileName = url, UseShellExecute = true }); } } From dbab7b6ab395a012e515416e6785a4c21349e0d9 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 8 Dec 2021 21:39:31 -0600 Subject: [PATCH 37/39] Optional Inprivate argument & Comment --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 5 ++++- Flow.Launcher/PublicAPIInstance.cs | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index f87ca3969..c5a5231c0 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -213,6 +213,9 @@ namespace Flow.Launcher.Plugin /// Extra FileName Info public void OpenDirectory(string DirectoryPath, string FileName = null); - public void OpenUrl(string url); + /// + /// Open Url in the configured default browser for Flow's Settings. + /// + public void OpenUrl(string url, bool? inPrivate = null); } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 46f192a91..f54bc23f0 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -114,7 +114,7 @@ namespace Flow.Launcher var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true); ShellCommand.Execute(startInfo); } - + public void CopyToClipboard(string text) { Clipboard.SetDataObject(text); @@ -209,7 +209,7 @@ namespace Flow.Launcher explorer.Start(); } - public void OpenUrl(string url) + public void OpenUrl(string url, bool? inPrivate = null) { var browserInfo = _settingsVM.Settings.CustomBrowser; @@ -217,10 +217,11 @@ namespace Flow.Launcher if (browserInfo.OpenInTab) { - url.OpenInBrowserTab(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); - }else + url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg); + } + else { - url.OpenInBrowserWindow(path, browserInfo.EnablePrivate, browserInfo.PrivateArg); + url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg); } } From 27d1796e486dafb9bc66de1165f2a7ecc0258965 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Wed, 8 Dec 2021 21:48:27 -0600 Subject: [PATCH 38/39] Fix Suggestion Result Action --- Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index 1394e8c15..31d56c108 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -136,7 +136,7 @@ namespace Flow.Launcher.Plugin.WebSearch ActionKeywordAssigned = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? string.Empty : searchSource.ActionKeyword, Action = c => { - searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)); + _context.API.OpenUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o))); return true; } @@ -156,7 +156,7 @@ namespace Flow.Launcher.Plugin.WebSearch _settings = _context.API.LoadSettingJsonStorage(); _viewModel = new SettingsViewModel(_settings); - + var pluginDirectory = _context.CurrentPluginMetadata.PluginDirectory; var bundledImagesDirectory = Path.Combine(pluginDirectory, Images); From b3b85c1868dc464b875234832c81252f44492bb4 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 9 Dec 2021 19:45:11 +1100 Subject: [PATCH 39/39] update comment --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index c5a5231c0..442657031 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -214,7 +214,7 @@ namespace Flow.Launcher.Plugin public void OpenDirectory(string DirectoryPath, string FileName = null); /// - /// Open Url in the configured default browser for Flow's Settings. + /// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings. /// public void OpenUrl(string url, bool? inPrivate = null); }