Skip to content
代码片段 群组 项目
未验证 提交 567ed0c7 编辑于 作者: Paddy Xu's avatar Paddy Xu 提交者: GitHub
浏览文件

Merge pull request #643 from lepathie/bugfix/#625_unsupported_protocols_open_in_browser

Bugfix for #625: The HtmlViewer opens `.url`s with unsupported protocols in internal browser.
No related branches found
No related tags found
无相关合并请求
// Copyright © 2017 Paddy Xu
// Copyright © 2017 Paddy Xu
//
// This file is part of QuickLook program.
//
......@@ -26,7 +26,8 @@ namespace QuickLook.Plugin.HtmlViewer
{
public class Plugin : IViewer
{
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".url" };
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html" };
private static readonly string[] SupportedProtocols = { "http", "https" };
private WebpagePanel _panel;
......@@ -39,7 +40,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)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册