mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-23 18:54:51 +00:00
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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Copyright © 2017 Paddy Xu
|
// Copyright © 2017 Paddy Xu
|
||||||
//
|
//
|
||||||
// This file is part of QuickLook program.
|
// This file is part of QuickLook program.
|
||||||
//
|
//
|
||||||
@@ -26,7 +26,8 @@ namespace QuickLook.Plugin.HtmlViewer
|
|||||||
{
|
{
|
||||||
public class Plugin : IViewer
|
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;
|
private WebpagePanel _panel;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ namespace QuickLook.Plugin.HtmlViewer
|
|||||||
|
|
||||||
public bool CanHandle(string path)
|
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)
|
public void Prepare(string path, ContextObject context)
|
||||||
|
Reference in New Issue
Block a user