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
IID
to 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 receivensIWebProgressListener
ornsISHistoryListener
notifications in which case theIID
is that of the interface.Syntax:
void nsIWebBrowser::addWebBrowserListener( in nsIWeakReference aListener, in nsIIDRef aIID)Parameters:
nsresult :
NS_OK
for successful registration.NS_ERROR_INVALID_ARG
if one of the arguments was invalid or the object did not implement the interface specified byaIID.
if
NS_ERROR_FAILUREaListener
did 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_ARG
if argument was invalid or the object did not implement the interface specified by the IID.
See also:
nsIWeakReference
Sets 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
nsIBaseWindow
interface. The chrome object must also implementnsIEmbeddingSiteWindow
.The chrome object may optionally implement
nsIInterfaceRequestor
,
nsIWebBrowserChromeFocus
,
nsIContextMenuListener
andnsITooltipListener
to receive additional notifications from the browser object.The chrome object may also optionally implement
nsIWebProgressListener
instead of explicitly callingaddWebBrowserListener
andremoveWebBrowserListener
to 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-
nsnull
value is always valid. The embedder must explicitly set this value back tonsnull
if the chrome object is destroyed before the browser object.See also:
nsIURIContentListener
Sets 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-
nsnull
value is always valid. The embedder should explicitly set this value back tonsnull
if the parent content listener is destroyed before the browser objectSee also:
nsIURIContentListener
Gets 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 |