Bug 4155 - Windows Forms WebBrowser doesn't work
Summary: Windows Forms WebBrowser doesn't work
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 2.10.x
Hardware: PC All
: Lowest normal
Target Milestone: Community
Assignee: Bugzilla
Depends on:
Reported: 2012-03-29 23:18 UTC by Juan Urroa
Modified: 2017-09-01 11:56 UTC (History)
3 users (show)

Tags: mono-community
Is this bug a regression?: ---
Last known good build:

Output of the test application using webkit (16.51 KB, text/plain)
2013-01-14 08:35 UTC, Alessandro Di Federico

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 4155 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Juan Urroa 2012-03-29 23:18:46 UTC
Fails in Windows and Linux
Fails with Webkit a Mozilla

I used mono 2.10.8 on windows
For linux Fedora 15 mono 2.10.5 and xulrunner 2.0.1 (i couldn't build libgluezilla with other versions)
All the errors seem to be about cross threading problems
Comment 1 Alessandro Di Federico 2013-01-14 08:34:37 UTC
Hi, I've a similar problem.

I'm trying to use webkit as a backend for the WebBrowser control. I don't use gecko because it's based on libgluezilla, which uses xulrunner, which is an abandoned project (nowadays the npapi-sdk should be used).

Here's a test case:

    public static void Main(string[] args)
        Form asd = new Form();
        WebBrowser wb = new WebBrowser();
        wb.Dock = DockStyle.Fill;

I'm using:
* mono 2.10.9
* webkit-sharp 0.3
* gtk-sharp 2.12.10

mono-webkit and my project target .Net 4.0.

Attached you can find the output I get when I run the application using MONO_BROWSER_ENGINE="webkit".

Any help is appreciated.
Comment 2 Alessandro Di Federico 2013-01-14 08:35:14 UTC
Created attachment 3212 [details]
Output of the test application using webkit
Comment 3 Hin-Tak Leung 2015-12-20 06:37:57 UTC
I could run your example directly, as is even from the sharp interactive prompt, with mono 4.0.5:

MONO_BROWSER_ENGINE=webkit MONO_PATH=mono-webbrowser/mono-webkit/ csharp -r:System.Windows.Forms

csharp> using System.Windows.Forms;
csharp>         Form asd = new Form();
csharp>         WebBrowser wb = new WebBrowser();
csharp>         wb.Navigate("http://google.com/");
csharp>         wb.Dock = DockStyle.Fill;
csharp>         asd.Controls.Add(wb);
csharp>         asd.ShowDialog();

Your crash looks the sort of crash I get from sgen vs boehm though...
Comment 4 Hin-Tak Leung 2016-06-06 09:08:47 UTC
Fixed all the rendering issues.

Please test:


Fixed all the rendering issues.
Comment 5 Juan Urroa 2016-06-07 22:41:23 UTC
And it was only four years after the original report, if I hurry up I can still end my project in time
Comment 6 Hin-Tak Leung 2016-06-08 01:28:19 UTC
I am just another user, offering my fix as a pull. No need to be sarcastic.
Comment 7 Hin-Tak Leung 2016-06-08 02:57:49 UTC
FWIW, my "bug fix" rewrite removed all the threading related code. I could not get the GUI events to deliver with the old threading code. Now the code is simpler, and at least it works.

4 embedded browser instances running in the same app on linux:

and even running with win32 mono with win32 webkit: