Wsw_PreProcessPage
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. It can be used to modify the page source or convert it to another format.
Parameters
- $sMem ... String expression. Memory string that contains the page source.
- $sStatusMessage ... String expression. The assigned text is displayed in the status column of the bookmark.
- $iStatusCode ... Integer value. Returns the success status of this function.
Valid values of $iStatusCode
- 0 ... OK.
Default value. Must not be assigned manually. - 2 ... Error.
If 2 is returned, the bookmark check is aborted and the text assigned to $sStatusMessage is 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