mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
Changed logic so that plugin only supports ".url"s that contain urls with protocol http or https
Ref: QL-Win#625
This commit is contained in:

committed by
Unknown

parent
208c5d5391
commit
cf29484208
@@ -26,7 +26,9 @@ namespace QuickLook.Plugin.HtmlViewer
|
||||
{
|
||||
public class Plugin : IViewer
|
||||
{
|
||||
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".svg", ".url" };
|
||||
// TODO: Handle urls based on protocol
|
||||
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".svg" };
|
||||
private static readonly string[] SupportedProtocols = { "http", "https" };
|
||||
|
||||
private WebpagePanel _panel;
|
||||
|
||||
@@ -39,7 +41,7 @@ namespace QuickLook.Plugin.HtmlViewer
|
||||
|
||||
public bool CanHandle(string path)
|
||||
{
|
||||
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
|
||||
return !Directory.Exists(path) && (Extensions.Any(path.ToLower().EndsWith) || (path.ToLower().EndsWith(".url") && SupportedProtocols.Contains(Helper.GetUrlPath(path).Split(':')[0].ToLower())));
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
|
Reference in New Issue
Block a user