You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.

nsIWebBrowser
Embedders use this interface during initialization to associate the new WebBrowser instance with the embedder's chrome and to register any listeners. The interface may also be used at runtime to obtain the content DOM window and from that the rest of the DOM. This interface is scriptable
Registers a listener of the type specified by the
IIDto receive callbacks. The browser stores a weak reference to the listener to avoid any circular dependencies. Typically this method is called to register an object to receivensIWebProgressListenerornsISHistoryListenernotifications in which case theIIDis that of the interface.Syntax:
void nsIWebBrowser::addWebBrowserListener( in nsIWeakReference aListener, in nsIIDRef aIID)Parameters:
nsresult :
NS_OKfor successful registration.NS_ERROR_INVALID_ARGif one of the arguments was invalid or the object did not implement the interface specified byaIID.if
NS_ERROR_FAILUREaListenerdid not expose the interface specified by the IID, or some other internal error occurred.
See also:
nsIWeakReference,nsIWebProgressListener,nsISHistoryListener.Removes a previously registered listener.
Syntax:
void nsIWebBrowser::removeWebBrowserListener( in nsIWeakReference aListener, in nsIIDRef aIID )Parameter:
nsresult:
NS_ERROR_INVALID_ARGif argument was invalid or the object did not implement the interface specified by the IID.
See also:
nsIWeakReferenceSets the chrome object. The embedder must create one chrome object for each browser object that is instantiated. This attribute associates the two by setting this property to point to the chrome object. This must be done before creating the browser window via the browser's
nsIBaseWindowinterface. The chrome object must also implementnsIEmbeddingSiteWindow.The chrome object may optionally implement
nsIInterfaceRequestor,nsIWebBrowserChromeFocus,nsIContextMenuListenerandnsITooltipListenerto receive additional notifications from the browser object.The chrome object may also optionally implement
nsIWebProgressListenerinstead of explicitly callingaddWebBrowserListenerandremoveWebBrowserListenerto register a progress listener object. If the implementation does this, it must also implementnsIWeakReference.Note:The implementation should not refcount the supplied chrome object; it should assume that a non-
nsnullvalue is always valid. The embedder must explicitly set this value back tonsnullif the chrome object is destroyed before the browser object.See also:
nsIURIContentListenerSets the URI content listener parent. Embedders may set this property to their own implementation if they intend to override or prevent how certain kinds of content are loaded.
Note: The implementation should not refcount this interface; it should assume that a non-
nsnullvalue is always valid. The embedder should explicitly set this value back tonsnullif the parent content listener is destroyed before the browser objectSee also:
nsIURIContentListenerGets the top-level DOM window.The embedder may walk the entire DOM starting from this value.
| Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |