## IE 4.0 : Browser Helper Extension

This document describes one of new features of IE 4.0, which is called "browser helper", which allows programmers to "attach" a COM object to each browser window to monitor user's action or add some capability to the browser window.

When a browser window (only top-level one, not an WebBrowser OC) is created, it looks up the registry enumerate all keys under the following registry key:

HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\BrowserHelperObject

Each key must be a valid CLSID for an In-Proc server. For each CLSID, the browser creates an instance of that class (by calling CoCreateInstance), QueryInterface to IID_IObjectWithSite (must be supported) and call its SetSite member with the IUnknown pointer to the automation interface of the browser window itself. Each attachment will be added as a browser property with the CLSID string as the property ID (using PutProperty member of IWebBrowserApp).

Such an helper object may register itself as an event sink to monitor the user's navigation or call automation interfaces to control the browser window. It's up to the helper object what it does when it receives such an event. If it requires to display any UI within the browser frame window, the programmer should register a UI component as one of BrowserBar extension.

Those helper objects will be released when the browser is being closed. They must release all the out-going interfaces and unregister themselves as event sinks when their SetSite member is called with NULL pointer -- not when their last reference counts are released (to break any circular reference counts).

Go back to IE 4.0 : Browser Extension Mechanism.