You are currently viewing a snapshot of 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, please file a bug.


Embedding Gecko API


This interface implements searches for text in a WebBrowser. The embedder can get one by doing a GetInterface on an nsIWebBrowser. By default, the implementation will search the focussed frame, or, if there is no focussed frame, the web browser content area. It does not by default search subframes or iframes. To change this behavior, and to explicitly set the frame to search, QI to nsIWebBrowserFindInFrames. This interface is scriptable.


Finds, highlights, and scrolls into view the next occurrence of the search string, using the current search settings. Fails if the search string is empty.


boolean nsIWebBrowserFind::findNext() 




PR_TRUE if search text found
PR_FALSE otherwise.
attribute wstring nsIWebBrowserFind::searchString

Gets and sets the string to search for. This must be non-empty to search.

attribute boolean nsIWebBrowserFind::findBackwards

Gets and sets whether to search backwards (towards the beginning of the document). The default value is FALSE, ie, search forward.

attribute boolean nsIWebBrowserFind::wrapFind

Gets and sets whether the search wraps around to the start (or end) of the document if no match was found between the current position and the end (or beginning). This works correctly when searching backwards. The default value is FALSE.

attribute boolean nsIWebBrowserFind::entireWord

Gets and sets the search to match entire words only. The default value is FALSE.

attribute boolean nsIWebBrowserFind::matchCase

Gets and sets the search to match case (case sensitive) when searching. The default value FALSE.

attribute boolean nsIWebBrowserFind::searchFrames

Gets and sets whether to search through all frames in the content area. The default value is TRUE.

Written by:Ellen Evans | Comments, questions, complaints? Bug 143387