GeckoFx in WPF

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

  1. 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 geckofunctioncheck

    
    private void browser_DocumentCompleted_gecko(object sender, GeckoDocumentCompletedEventArgs e)
    {
    AutoJSContext context = new AutoJSContext(browser_3w.Window); 
    context.EvaluateScript("geckofunctioncheck()"); 
    }
    


 
Namespaces



using Gecko;
using Gecko.Events;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.