Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Firefox/Gecko in WPF/C#

I want to embed the current Gecko in my WPF-Project. I know there is the possibility with the Winforms-Host and the Skybound-Gecko-Library.

But I do not use the standard wpf-theme for my application. It is another and the scrollbar of the control will not be styled. Furthermore, this is an old library which is designed for Firefox 3.

Which is the best library/strategy to use the current Gecko in WPF?

like image 706
0xDEADBEEF Avatar asked Sep 26 '11 07:09

0xDEADBEEF


2 Answers

You should have a look at these options, they all use Chromium:

paid: (Awesomium-based)

  • http://awesomium.com/ (is free for startups)
  • http://wpfchromium4.codeplex.com/ (uses awesomium)

free: (Chrome Embedded Framework-based)

  • https://github.com/chillitom/CefSharp (provides WinForms and WPF, but uses CEF1)
  • https://bitbucket.org/xilium/xilium.cefglue/wiki/Home (uses CEF3, and therefore supports Chrome's multi-process model, flash plugin, and WebGL)
like image 162
albertjan Avatar answered Oct 17 '22 09:10

albertjan


You can probably use WindowsFormsHost, tutorial here

https://nhabuiduc.wordpress.com/2014/09/18/geckofx-net-webbrowser-setup-and-features/

the interesting part is

WindowsFormsHost host = new WindowsFormsHost(); 
GeckoWebBrowser browser = new GeckoWebBrowser(); 
host.Child = browser; 
gridWeb.Children.Add(host);
like image 8
Roman Avatar answered Oct 17 '22 08:10

Roman