WebBrowser

From Mono


Table of contents

Motivation: WebBrowser control for MWF

One of the most widely use and arguably the most popular control in use in System.Windows.Forms, is the InternetExplorer ActiveX WebBrowser control. Its support in Managed.Windows.Forms is becoming rapidly recessionary to facilitate the bridging of many apps from SWF to MWF.

The natural cross platform alternative to Internet Explorer is the Mozilla project's Gecko engine. Thanks to the efforts of the Mozilla ActiveX control team, many of the features in Internet Explorer now have direct equivalents in the Mozilla embedding API. However the Mozilla ActiveX control is only meant to work on Windows because of the ActiveX dependencies.

This concludes that we must wrap those interfaces ourselves. Since .NET generates assembly wrappers for ActiveX components for all the communication to the ActiveX control without exposing that its ActiveX underneath, we can implement the wrapper interfaces at this level without having to implement all of ActiveX.

Architecture of the IE component stack

SHDocVw.dll

This COM dll is the core of the Internet Explorer automation api. It exposes the e embeddable activeX control, as well as all the automation of externally launch instances of IE.

mshtml.dll

This COM dll is the core of the Microsoft HTML DOM api.

BrowseUI.dll

This COM dll is the core of the Windowing Toolkit of IE. This feature is not necessary for what we are trying to striving for, however it is referenced in my documents on the subject.


References

Architecture:

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/overview/Overview.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/ae1592b6-2afd-4379-a18e-d46b226bc9e2.asp

http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowserbase(VS.80).aspx

Implementation Overview

The WebBrowser implimentation is made up of several parts:

  • Mono.Mozilla.dll - This managed code wrapper is the core interface between libmozembed and managed code. It's abstract to all implementations and windowing toolkits.
  • Mono.Mozilla.WebBrowser.dll - A System.Windows.Forms/Managed.Windows.Forms control that embeds Mozilla and exposes the root features of libmozembed
  • Mono.Mozilla.Widget.dll - A GTK# Widget that embeds Mozilla and exposes the root features of libmozembed
  • Interop.SHDocVw.dll - the managed implementation of the COM wrapper generated by tlb2asm
  • AxInterop.SHDocVw.dll - the managed implementation of the ActiveX System.Windows.Forms control generated by tlb2asm
  • Interop.mshtml.dll - the managed implementation of the COM wrapper generated by tlb2asm