Use chrome as browser in C#?
Asked Answered
D

9

48

Is there a way to use Google Chrome (or Safari or Firefox) as the browser in a C# application? C# now uses Internet Explorer, and the website they want to use in this program doesn't support it.

Denude answered 26/1, 2010 at 18:33 Comment(1)
DotNetBrowser provides Chromium-based controls which you can use to display your website in a .NET application (both WPF and WinForms are supported). The library is commercial, but there are free academic and open-source licences, and it has plenty of features. In addition, it is able to work off-screen and does not depend on the local installation.Northrop
P
55

You can use WebKit.NET. This is a C# wrapper for WebKit, which is the rendering engine used by Chrome.

Predella answered 26/1, 2010 at 18:35 Comment(1)
Technically Blink is the rendering engine in Chrome now. It used to be WebKit but Google forked it so they could go in their own direction a few years ago.Carillon
N
42

You can use GeckoFX to embed firefox

Natalia answered 26/1, 2010 at 18:35 Comment(2)
Probably because the question is about chrome.Possibility
Except that the question specifically states, "(safari or firefox may [sic] also)" ;)Natalia
A
12

I don't know of any full Chrome component, but you could use WebKit, which is the rendering engine that Chrome uses. The Mono project made WebKit Sharp, which might work for you.

Agency answered 26/1, 2010 at 18:37 Comment(0)
P
10

I use Awesomium, I think it is better than GeckoFX/WebKit http://awesomium.com

Pyo answered 12/5, 2013 at 18:58 Comment(5)
awesomium probably by far the best, not if anyone happens to look at this thread in 2013, forgot those other mentioned ones, check out awesomiumVaulting
Yeah but the cost is out there.Shylashylock
You can use It for Free, If You do not use It for big commercial usePyo
Any examples on saving to image?Peele
awesomium having problem when executing javascript with result :(Prelate
R
5

OpenWebKitSharp gives you full control over WebKit Nightly, which is very close to webkit in terms of performance and compatibility. Chrome uses WebKit Chromium engine, while WebKit.NET uses Cairo and OpenWebKitSharp Nightly. Chromium should be the best of these builds, while at 2nd place should come Nightly and that's why I suggest OpenWebKitSharp.

http://gt-web-software.webs.com/libraries.htm at the OpenWebKitSharp section

Recurved answered 6/10, 2011 at 18:5 Comment(0)
S
3

1/3/2017 --> January the 3rd 2017

Hi there, today I found this article to achieve this, the article is called "Creating an HTML UI for Desktop .NET Applications" and is intended to embed a chromium based control in a WPF application. It saved me the day.

https://www.infoq.com/articles/html-desktop-net

I hope it helps somebody else.

NOTE: it is based on DotNetBrowser, see license agreement here: https://www.teamdev.com/dotnetbrowser-licence-agreement

Sissel answered 3/1, 2017 at 9:35 Comment(0)
F
2

Try this: http://code.google.com/p/geckofx/

Fradin answered 26/1, 2010 at 18:37 Comment(0)
J
2

Update for 2014:

I use geckofx, a healthy open source project that (as of this writing) keeps up to date pretty well with the latest Firefox releases.

To embed Chrome, you might consider another healthy looking open source project, Xilium.cefGlue, based on The Chromium Embedded Framework (CEF).

Both of these support WPF and Winforms, and both projects have support for .net and mono.

Jodi answered 10/3, 2014 at 23:46 Comment(1)
Which of these are best for non-interactive uses? I.e., I just want to load a particular page, have all the javascript execute (excluding anything that requires user input), then programmatically query the DOM for information about the page as part of server-side processing with no UI. Ideally I'd have the ability to override how content is loaded, and to be informed when any modal (alert/confirm) dialogs are shown.Ruggles
C
2

Update 2016:

Unfortunately most of the above solutions are out of date and no longer maintained.

There are 3 additional options I can suggest that are still actively developed:

1. BrowseEmAll.Cef

A .Net component that can be used to integrate the Chrome engine into your .Net Application. Based on CefGlue but a little faster on updates to the latest Chrome version. Also there is a commercial support option available which might come in handy for some. Of course the component itself is open source.

2. BrowseEmAll.Gecko

Another .Net component which can be used to integrate the Firefox engine into your .Net application. This is based on Geckofx but unlike the current version of Geckofx this will work with a normal release build of Firefox. To use Geckofx you will need to build Firefox yourself. Again commercial support is available but the component itself is fully open source.

3. BrowseEmAll Core API

Need all the different browsers in your .Net Application? Which the BrowseEmAll Core API you can integrate Chrome, Firefox, Webkit and Internet Explorer into your application. This is a commercial product though so be warned.

(Full disclosure: I work for this company so take everything I say with a grain of salt)

Commutation answered 13/2, 2016 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.