![]() |
![]() ![]() ![]() |
IESniffer component.
|
function TIESniffer.MarkText(Browser: IWebBrowser2; const Text: String;
|
FontColor: TColor = clBlack; BackgroundColor: TColor = clYellow;
|
WholeWords: Boolean = False; MatchCase: Boolean = False; ScanFrames: Boolean = True;
|
const MarkID: String = 'IESnifferMark'): Integer; // returns number of marked words
|
The MarkText method searches for all occurences of the Text on the Web page and marks it with specified foreground (FontColor parameter) and background (BackgroundColor parameter) colors.
|
|
Parameter | Meaning
|
Browser | is the IWebBrowser2 interface with some text which should be marked.
|
Text | is the word or phrase which should be marked in the HTML document.
|
FontColor | specifies the font color to mark the found text.
|
BackgroundColor | specifies the background color to highlight the text.
|
WholeWords | whether the Text should match whole words only.
|
MatchCase | whether the Text should match case.
|
ScanFrames | whether to scan subframes of the web page (True by default).
|
MarkID | identifier of marked text which must be used if you plan to clear marks. (ClearMarks method can clear the marks from keywords with specified MarkID).
|
|
Function returns the number of marked text fragments, or 0 if specified Text was not found on the page.
|
procedure TForm1.IESniffer1WBDownloadComplete(Sender: TObject;
|
const URL: String; const Browser: IWebBrowser2);
|
begin
|
// highlights AppControls keyword with yellow color
|
IESniffer1.MarkText(Browser, 'AppControls', clBlack, clYellow);
|
end;
|
ReplaceText method;
|
OnWindowLoad and OnWBDownloadComplete events.
|