Add example of setting preference on RequestContext you just created

This commit is contained in:
amaitland
2016-09-26 09:05:52 +10:00
parent 3066b19f84
commit 2b419cd29f
@@ -42,8 +42,18 @@ namespace CefSharp.Wpf.Example.Views
//You can specify a custom RequestContext to share settings amount groups of ChromiumWebBrowsers
//Also this is now the only way to access OnBeforePluginLoad - need to implement IPluginHandler
//browser.RequestContext = new RequestContext(new PluginHandler());
//NOTE - This is very important for this example as the default page will not load otherwise
//browser.RequestContext.RegisterSchemeHandlerFactory(CefSharpSchemeHandlerFactory.SchemeName, null, new CefSharpSchemeHandlerFactory());
//You can start setting preferences on a RequestContext that you created straight away, still needs to be called on the CEF UI thread.
//Cef.UIThreadTaskFactory.StartNew(delegate
//{
// string errorMessage;
// //Use this to check that settings preferences are working in your code
// var success = browser.RequestContext.SetPreference("webkit.webprefs.minimum_font_size", 24, out errorMessage);
//});
browser.RenderProcessMessageHandler = new RenderProcessMessageHandler();
browser.LoadError += (sender, args) =>