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

@@ -1,4 +1,4 @@
// Copyright © 2017 Paddy Xu
// Copyright © 2017 Paddy Xu
//
// This file is part of QuickLook program.
//
@@ -63,5 +63,25 @@ namespace QuickLook.Plugin.HtmlViewer
key?.SetValue(appName, value, RegistryValueKind.DWord);
}
}
internal static string GetUrlPath(string url)
{
int index = -1;
string[] lines = File.ReadAllLines(url);
foreach (string line in lines)
{
if (line.ToLower().Contains("url="))
{
index = System.Array.IndexOf(lines, line);
break;
}
}
if (index != -1)
{
var fullLine = lines.GetValue(index);
return fullLine.ToString().Substring(fullLine.ToString().LastIndexOf('=') + 1);
}
return url;
}
}
}