Display .url files as webpage (#550)

This commit is contained in:
Jethro-Alter
2019-09-23 10:02:19 +02:00
committed by Paddy Xu
parent c5000d9a66
commit da02d6d6ee
3 changed files with 34 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ namespace QuickLook.Plugin.HtmlViewer
{
public class Plugin : IViewer
{
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".svg" };
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".svg", ".url" };
private WebpagePanel _panel;
@@ -44,7 +44,7 @@ namespace QuickLook.Plugin.HtmlViewer
public void Prepare(string path, ContextObject context)
{
context.PreferredSize = new Size(1000, 600);
context.PreferredSize = new Size(1280, 720);
}
public void View(string path, ContextObject context)
@@ -53,6 +53,10 @@ namespace QuickLook.Plugin.HtmlViewer
context.ViewerContent = _panel;
context.Title = Path.IsPathRooted(path) ? Path.GetFileName(path) : path;
if (path.ToLower().EndsWith(".url"))
{
path = Helper.GetUrlPath(path);
}
_panel.LoadFile(path);
_panel.Dispatcher.Invoke(() => { context.IsBusy = false; }, DispatcherPriority.Loaded);
}