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.
author: Aleš Rosina | Comments: 5 | 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
It works at home, thanks ;-) Useful !!!
Is there any tutorial for beginners which deals with navigation a URL to manipulating DOM or accessing Javascript?
thx
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=69e2c724-f75f-47cd-8213-250d99a23ee2)
