Wsw_PreProcessPage

Top  Previous  Next

Sub Wsw_PreprocessPage(ByRef $sMem, ByRef $sStatusMessage, ByRef $iStatusCode)

 

This function is called immediately after a page has been downloaded and before any other processing starts. This function can be used to modify the page source or even to convert it into another format.

 

Parameters

 

$sMem ... String expression. Memory string of the page source.
$sStatusMessage ... String expression. The assigned text will be displayed in the status column of the bookmark.
$iStatusCode ... Integer value. Returns the success status of that function.

 

Valid values of $iStatusCode:

0 ...

OK.

Default value, must not be assigned manually.

2 ...

Error.

If 2 is returned, then the check of that bookmark will be aborted and the text assigned to $sStatusMessage will be displayed in the status column.

 

Example:

Sub Wsw_PreprocessPage(ByRef $sMem, ByRef $sStatusMessage, ByRef $iStatusCode)

   

   Dim $nStart, $nLen

   

   ' Exit if no session ids are available (small performance improvement)

   If InStr($sMem, "sid=") = 0 Then

      Return

   End If

   

   ' Remove all session ids found in the page source

   While FindRegex($sMem, "&(amp;)*sid=[a-z,0-9]*", $nStart, $nLen)

      Delete($sMem, $nStart, $nLen)

   End While

End Sub