From cf2948420809e591d23d73aa2aae4c59d44a8f19 Mon Sep 17 00:00:00 2001 From: Leon Pascal Thierschmidt Date: Thu, 9 Apr 2020 01:03:56 +0200 Subject: [PATCH] Changed logic so that plugin only supports ".url"s that contain urls with protocol http or https Ref: QL-Win#625 --- QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.cs b/QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.cs index 6acc768..8d6cade 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/Plugin.cs @@ -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)