Webbrowser component for WPF application. Default web browser component may have some limitation in terms of rendering webkits, html5.
GecoFx will help to render html5, etc.,
Below is a sample , how integrate GecoFx into your WPF Application
Install GecoFx from Nuget
PM> Install-Package GeckoFX -Version 1.0.5
Below are some of the functionalities frequency used with GeckoFx
- How to Invoke a script from GecoFx Control
if user needs to execute a certain javascript function found in html page , you can use the below code to trigger the function.GeckoWebBrowser browser_gecko= new GeckoWebBrowser(); browser_gecko.Navigate("https://gcatch.in/wp-content/uploads/2018/03/GecoFx.html"); browser_gecko.DocumentCompleted += browser_DocumentCompleted_gecko;
https://gcatch.in/wp-content/uploads/2018/03/GecoFx.html , you can check the page source and check javascript code for reference. below code will execute the function geckofunctioncheckprivate void browser_DocumentCompleted_gecko(object sender, GeckoDocumentCompletedEventArgs e) { AutoJSContext context = new AutoJSContext(browser_3w.Window); context.EvaluateScript("geckofunctioncheck()"); }
Namespaces
using Gecko;
using Gecko.Events;