Go back from Webkit to IE render engine

This commit is contained in:
Paddy Xu
2017-06-01 19:49:54 +03:00
parent 69cad9c841
commit 20fbda1e44
28 changed files with 352 additions and 14573 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.IO;
using System.Text;
using System.Windows.Controls;
using System.Windows.Threading;
namespace QuickLook.Plugin.HtmlViewer
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class WebpagePanel : UserControl, IDisposable
{
public WebpagePanel()
{
InitializeComponent();
Helper.SetBrowserFeatureControl();
}
public void Dispose()
{
browser?.Dispose();
browser = null;
}
public void Navigate(string path)
{
if (Path.IsPathRooted(path))
path = Helper.FilePathToFileUrl(path);
browser.Dispatcher.Invoke(() => { browser.Navigate(path); }, DispatcherPriority.Loaded);
}
public void LoadHtml(string html)
{
var s = new MemoryStream(Encoding.UTF8.GetBytes(html ?? ""));
browser.Dispatcher.Invoke(() => { browser.Navigate(s); }, DispatcherPriority.Loaded);
}
}
}