Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,13 @@ public interface IPublicAPI
public void OpenDirectory(string DirectoryPath, string FileName = null);

/// <summary>
/// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings.
/// Opens the URL. The browser and mode used is based on what's configured in Flow's default browser settings.
/// Also supports application URIs e.g. obsidian://search-query-example
/// </summary>
public void OpenUrl(string url, bool? inPrivate = null);

/// <summary>
/// Opens the application URI.
/// Opens the application URI, e.g. obsidian://search-query-example
/// </summary>
public void OpenAppUri(string appUri);
}
Expand Down
23 changes: 9 additions & 14 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void OpenDirectory(string DirectoryPath, string FileName = null)
explorer.Start();
}

public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false)
private void OpenUri(string url, bool? inPrivate = null)
{
var uri = new Uri(url);
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
Expand All @@ -230,18 +230,7 @@ public void OpenUri(string url, bool? inPrivate = null, bool isAppUri = false)
return;
}

if (isAppUri)
{
Process.Start(new ProcessStartInfo()
{
FileName = url,
UseShellExecute = true
})?.Dispose();

return;
}

throw new InvalidOperationException("URI scheme not specified or supported ");
OpenAppUri(url);
}

public void OpenUrl(string url, bool? inPrivate = null)
Expand All @@ -251,7 +240,13 @@ public void OpenUrl(string url, bool? inPrivate = null)

public void OpenAppUri(string appUri)
{
OpenUri(appUri, isAppUri: true);
Process.Start(new ProcessStartInfo()
{
FileName = appUri,
UseShellExecute = true
})?.Dispose();

return;
}

public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
Expand Down
5 changes: 3 additions & 2 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
var title = keyword;
string subtitle = _context.API.GetTranslation("flowlauncher_plugin_websearch_search") + " " + searchSource.Title;

//Action Keyword match apear on top
// Action Keyword match apear on top
var score = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? scoreStandard : scoreStandard + 1;

// This populates the associated action keyword search entry
if (string.IsNullOrEmpty(keyword))
{
var result = new Result
Expand All @@ -61,6 +62,7 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
IcoPath = searchSource.IconPath,
Score = score
};

results.Add(result);
}
else
Expand Down Expand Up @@ -93,7 +95,6 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)

if (token.IsCancellationRequested)
return null;

}

return results;
Expand Down