WebKit vs. IE browser control in C#
Recently I needed to include a web browser control (in Windows Forms project), so the logical choice would be WebControl, which is actually only .NET wrapper around Internet Explorer’s ActiveX control.
Well, I wanted to try some other engines, like WebKit (which is core of Apple Safari, Google Chrome, Adobe AIR, etc.), since IE engine (called Trident) scores on Acid3 very low (13 out of 100) and WebKit engine scores almost perfect (99 out of 100). For most cases this is not important, since most of web pages are done with optimizations for all browsers, but sometimes it is.
So for this test I’ve created very simple application, where you can compare those two rendering engines (you can download this app here, if you’re not interested in code).
I have run this app on a different sites and found out, that WebKit renders pages faster, if there is a lot of JavaScript behind, where simple plain HTML pages is rendered faster by Internet Explorer engine. So based on that, you have to decide which control to use in your application.
For WebKit implementation I’ve used WebKit.NET, which is using Cairo derivate of WebKit (how to build it on your own, read here) and already includes binaries, so all you need to do, is to include WebKitBrowser in your toolbox in Visual Studio (right click on Toolbox > Choose items > .NET Framework Components > Browse… and select WebKitBrowser.dll from previously downloaded zip file) and drag it into your Form. Using this component is basically the same as using WebBrowser control, so you start navigation with
webBrowser1.Navigate(textBox1.Text);
and do something when document is loaded on event:
private void webBrowser1_DocumentCompleted(And that’s it, you just created a very simple web browser.
object sender, WebBrowserDocumentCompletedEventArgs e) { //... }
You can download project (with source code) here, so you can play with code or if you want only app, download it here.
| Tweet |
author: Aleš Rosina | Comments: 14 | Tags: c-sharp, webkit, trident, internet-explorer
February
2010
Hi tried the web kit works like a charm.
I was building an application which used google earth(geplugin)
to show the earth in a browser control in c#.net
Recently google launched chrome frame. now i am unable to load the same document as now google earth uses chrome frame to route everything through google chrome. I have added the meta tag as they insisted but still the chrome frame was unable to load... Anyways my question was...
that for the default web browser control in c#.net wrapping IE i used to use.
this.wbOnline2DMap.Document.InvokeScript("FlyHere", new string[] { this.tbMapTxtLocation.Text });
inorder to invoke an external javascript method from my app. Cant find this function in webkit bowser. Any help please urgently...
hi
Need to call javascript function from c#.net
I did this in the traditional IE browser control in c#.net
this.wbOnline2DMap.Document.InvokeScript("FlyHere", new string[] { this.tbMapTxtLocation.Text });
what should i do for web kit browser control
sorry for the multiple posts. got some errors on my page
Is there any tutorial for beginners which deals with navigation a URL to manipulating DOM or accessing Javascript?
thx
I face this below problem when I tried to use it
Could not load type 'WebKit.WebKitBrowser' from assembly 'WebkitBrowser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
can anybody pls assist me to recover it?
Did you read tutorial from webkitdotnet.sourceforge.net/.../webkit.php this url and added DLL to references in your project?
It is amazing to see the scores of Webkit on the acid3 because this type of results cannot be seen on IE it always show low scores which is not appreciable. Even Firefox does not show high scores it shows approximately 53. I think this apple originated Webkit is the first browser to score high rank in the acid3.
Hi, This WebKit control could not open any site except Google. What is the problem? please reply.
.Net WebBrowser control has "document" property which is very important to work but I could not find it in Webkit.
Please reply with example, how can I handle this by Webkit.
could you please help me in implementing a click event of button within the webkit browser through coding , example if a site is loaded in the webkit browser then from that site i need to click any button through coding.
could i use this control in wpf application ?
Thanks for the informative post. Using the WebkitBrowser control how can I load an html file from disk? I have tried file:///C:/path_to_html/htmfiletoload.html with no success.
im using the webkit browser control in visual studio express 2010 on vb.net
im using a tabcontrol and im adding tabs dynamic when clicking on a link
and i cant figure out " how capture the new Url "
so i would know what to open the new tab
there is a tabcontrol and two tabs open already
on each tab there is a webkit browser control
this is the code:
Private Sub WebKitBrowser1_NewWindowRequest1(ByVal sender As Object, ByVal args As WebKit.NewWindowRequestEventArgs) Handles WebKitBrowser1.NewWindowRequest
'newOpenedWindow is a WebkitBrowser control in another tab
newOpenedWindow.Navigate(args.Url)
newOpenedWindow.Dock = DockStyle.Fill
End Sub
Petra was elected as a headquarter of the Nabateans for the reason that it was situated in a basin bordered by mountains of sandstones. There are several routes that lead into the capital, but not a single of them are unchallenging, and in case the gorges are closed, it is nearly unfeasible for any person to get inside the city.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=69e2c724-f75f-47cd-8213-250d99a23ee2)
