Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
9 changes: 7 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Url/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// IP address dotted notation octets
// excludes loopback network 0.0.0.0
// excludes reserved space >= 224.0.0.0
// excludes network & broacast addresses

Check warning on line 26 in Plugins/Flow.Launcher.Plugin.Url/Main.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`broacast` is not a recognized word. (unrecognized-spelling)
// (first & last IP address of each class)
"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" +
"(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" +
Expand Down Expand Up @@ -60,9 +60,9 @@
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
{
Expand Down Expand Up @@ -97,6 +97,11 @@
return [];
}

private static string GetHttpPreference()
{
return Settings.AlwaysOpenWithHttps ? "https" : "http";
}

public bool IsURL(string raw)
{
raw = raw.ToLower();
Expand Down
2 changes: 2 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Url/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ public bool OpenInNewBrowserWindow
public bool OpenInPrivateMode { get; set; } = false;

public string PrivateModeArgument { get; set; } = string.Empty;

public bool AlwaysOpenWithHttps { get; set; } = false;
}
}
9 changes: 9 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>

<CheckBox
Expand Down Expand Up @@ -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}"

Check warning on line 123 in Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`usehttps` is not a recognized word. (unrecognized-spelling)
IsChecked="{Binding Settings.AlwaysOpenWithHttps, Mode=TwoWay}" />
</Grid>
</UserControl>
Loading