Chrome browser can be embedded in native application taking a hybrid approach to development where application is partly developed in native technology and partly in web. This has several advantages:
- The part of application written in web technology is platform independent. This is very important due to variety of devices that are prevalent today.
- Overcome the limitation of web technology and leverage the full power of the hardware through native code.
We need to know about three projects:
|Chromium||Web Browser||Chromium is the open source browser project which is behind Google Chrome.|
|Web Browser Control||Based on Chromium project, an open source embed-able Web Browser Control is developed called ChromiumEmbedded. ChromiumEmbedded supports programming interface for C++.|
|Xilium.CefGlue||.Net Wrapper||Quite a few wrappers are available to make ChromiumEmbedded accessible in other languages. The most updated and active wrapper for .Net is Xilium.CefGlue.|
Follow the below steps to embed Chromium Web Browser control in your .Net application.
- Download the source code for Xilium from here (Click on the Branches tab and download the Master branch).
- Check for the current ChromiumEmbedded (CEF) build supported by Xilium here. As of now, the ChromiumEmbedded supported build is CEF 3.1547.1448. Download the relevant pre build binaries from here.
- Unzip the two downloaded files. Copy all DLLs from the Release folder of ChromuimEmbedded and place it in Debug folder of CefGlue.Demo.WinForms project in Xilium source code.
- Copy the locales folder under Resources from ChromuimEmbedded and place it in the Debug folder of CefGlue.Demo.WinForms project in Xilium source code.
- Open the Xilium source code in Visual Studio using Xilium.CefGlue.sln. Set CefGlue.Demo.WinForms as the startup project.
- Build and run the solution and you will get the demo .Net application running with embedded chromium browser.