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.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIWebBrowserFind


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.

Methods
findNext

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.

Syntax:

boolean nsIWebBrowserFind::findNext() 

Parameters:

None.

Result:

PR_TRUE if search text found
PR_FALSE otherwise.
Attributes
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
TOC PREV NEXT INDEX