Add LoadHtml extensions method - use data uri to load the html

This commit is contained in:
amaitland
2017-02-01 15:28:24 +10:00
parent c0ec00953a
commit 01e7e6f3d7
2 changed files with 23 additions and 3 deletions
+1 -3
View File
@@ -481,9 +481,7 @@ namespace CefSharp.WinForms.Example
if (control != null)
{
const string html = "<html><head><title>Test</title></head><body><h1>Html Encoded in URL!</h1></body></html>";
var base64EncodedHtml = Convert.ToBase64String(Encoding.UTF8.GetBytes(html));
control.Browser.Load("data:text/html;base64," + base64EncodedHtml);
control.Browser.LoadHtml(html, false);
}
}
}