Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to WebBrowser control in WPF?

Tags:

wpf

We are working on a WPF app with the web browser control. When the user drags the window, the web browser lags behind the window as it drags.

Does anyone know how to solve this issue? Failing that, does anyone know an alternative to the web browser control itself?

Thanks!

like image 993
rsteckly Avatar asked Aug 30 '10 03:08

rsteckly


2 Answers

Yes, as long as you don't require IE specific features you can use Awesomium which basically gives the same browser engine used by Google Chrome except for everything is rendered in pure WPF. For a while it was open source but I believe it is becoming a commercial product.

like image 117
jpierson Avatar answered Nov 15 '22 10:11

jpierson


I haven't heard about any Native WPF WebBrowser Control. The only options I know are based on Win32 controls which are wrapped into WPF controls in order to displayed. (See more details at http://msdn.microsoft.com/en-us/library/ms752055.aspx )

Recently I have to use the WPF wrapper for the WebBrowser control, and it's very limited regarding the options available for the developer. During my research I found that you are able to inject scripts or html content in order to modify the page behavior. Also, you can call .NET code (e.g. CSharp function from Javascript).

However tasks such as accessing the cache, modifying cookies are difficult task or changing the web browser behavior are very difficult. Here is when you will have to use DLL Imports in order to invoke unmanaged routines (see http://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx )

It's possible to look for an alternative WebBrowser control such as:

http://code.google.com/p/csexwb2/

http://wpfchromium.codeplex.com/

I hope this helps

like image 25
hmadrigal Avatar answered Nov 15 '22 10:11

hmadrigal