Hello
Sometimes, Gecko may interpretate generated content source and the equivelent raw source code differently. To see if this is the case, comment out the content-generating javascript (with /./) and insert the equivelent source code (obtained from the view source window). Test in the browser. Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation. Portions of this content are ©1998–2021 by individual mozilla.org contributors. Content available under a Creative Commons license.
GeckoFX has been around for a while and it’s been developed by Mozilla, the Firefox web browser developers. Although C# and VB.NET developers loosely use the built-in WebBrowser controls, which is based on Internet Explorer, there are times and reasons, good ones, that the WebBrowser control may be ditched and be replaced by a free, elegant, smooth, and WYSIWYG browser.
My reasons for using GeckoFX web browser was that I’m recently building a project which I’m trying to make it compatible to be run on OSX and Linux using Wine (or Mono). Yes, I’m being lazy for not building native app. The .NET’s WebBrowser control is not supported by Wine (or Mono) because it is still built upon Internet Explorer’s ActiveX architecture is heavily dependent upon the Windows environment. Wine has tried a lot to replicate the WebBrowser libraries but has not yet succeeded. So the GeckoFX browser comes to the rescue.
It is easy to use, supports all the functionality of a modern web browser, and it’s portable!
Mozilla Gecko Tab
So to start off… you need the following files:
- The GeckoFX libraries (get it from https://bitbucket.org/geckofx). Currently the version I’m using is 29.
- The XULRunner (get it from http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/)
Firefox Os Download
Step 1: Download the above files. For XULRunner, ensure you download a matching version number. For example if you are going to use the version 29 of GeckoFX libraries, the XULRunner has to be version 29 as well (currently Mozilla has up to version 33 available already!).
Step 2: Extract the above files. In Visual Studio in your C# or VB.NET project, reference the files you extracted from GeckoFX. There should be two libraries “Geckofx-Core.dll” and “Geckofx-Winforms.dll”. You need to reference them both, and set the property to Copy to Local path, so that library files are copied to your project’s executable files.
Step 3: Next step is to place the XULRunner folder inside the project’s executable directory (e.g. [project]bindebugxulrunner*)
Step 4: You can add the GeckoFX browser to your toolbar by right-clicking on the toolbar and selecting Choose Items. Select the GeckoFX web browser so that it’s icon starts appearing in the toolbar. You can create a GeckoFX browser at runtime as well if you wish to.
Step 5: The XULRunner, which works as a runtime for the GeckoFX browser, has to be initialized in the project. A1 website download. The following code is needed:
The above code initializes the XULRunner runtime files and enables the GeckoFX web browser to function. You can place this code at the application startup event or anytime before initializing the web browser control. Your web browser should be up and running now.
Step 6: At application shutdown, the GeckoFX browser needs to be cleanly disposed. So do the following:
This closes the XULRunner services and allows a smooth shutdown of the application. If the above code is not performed at application shutdown, it gives a crash error. I’ve personally not witnessed this but if the documentation says so then you should do it.
That’s it. Hope it’s working great for you. GeckoFX is fully compatible with Wine and I’ve tested it on Ubuntu and OSX Mavericks.
F.