mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #4037 from AWAS666/httpspref
Prefer https over http setting for url
This commit is contained in:
commit
e6c4cc25e5
4 changed files with 20 additions and 2 deletions
|
|
@ -19,4 +19,6 @@
|
|||
<system:String x:Key="flowlauncher_plugin_url_new_window">New window</system:String>
|
||||
|
||||
<system:String x:Key="flowlauncher_plugin_url_private_mode">Private mode</system:String>
|
||||
|
||||
<system:String x:Key="flowlauncher_plugin_url_usehttps">Prefer https over http</system:String>
|
||||
</ResourceDictionary>
|
||||
|
|
@ -60,9 +60,9 @@ namespace Flow.Launcher.Plugin.Url
|
|||
Score = 8,
|
||||
Action = _ =>
|
||||
{
|
||||
if (!raw.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
if (!raw.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && !raw.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
raw = "http://" + raw;
|
||||
raw = GetHttpPreference() + "://" + raw;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
@ -97,6 +97,11 @@ namespace Flow.Launcher.Plugin.Url
|
|||
return [];
|
||||
}
|
||||
|
||||
private static string GetHttpPreference()
|
||||
{
|
||||
return Settings.AlwaysOpenWithHttps ? "https" : "http";
|
||||
}
|
||||
|
||||
public bool IsURL(string raw)
|
||||
{
|
||||
raw = raw.ToLower();
|
||||
|
|
|
|||
|
|
@ -47,5 +47,7 @@
|
|||
public bool OpenInPrivateMode { get; set; } = false;
|
||||
|
||||
public string PrivateModeArgument { get; set; } = string.Empty;
|
||||
|
||||
public bool AlwaysOpenWithHttps { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CheckBox
|
||||
|
|
@ -113,5 +114,13 @@
|
|||
IsChecked="{Binding Settings.OpenInPrivateMode, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<CheckBox
|
||||
Grid.Row="2"
|
||||
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Content="{DynamicResource flowlauncher_plugin_url_usehttps}"
|
||||
IsChecked="{Binding Settings.AlwaysOpenWithHttps, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
|||
Loading…
Reference in a new issue