Public Sub NavigateToPage(ws As WebSocket, PageId As String, TargetUrl As String) 'ignore
'----------------------MODIFICATION-------------------------------
Dim testTargetUrl As String = TargetUrl
If Not(testTargetUrl.EndsWith(".htm") Or testTargetUrl.EndsWith(".html") Or testTargetUrl.EndsWith("/")) Then
TargetUrl = TargetUrl & "/"
End If
If PageId.Length > 0 Then ABM.RemoveMeFromCache(CachedPages, PageId)
If ws.Open Then
' it doesn't keep navigation history in the browser (the back button exists the application)
'ws.Eval("window.location.replace(arguments[0])", Array As Object(TargetUrl))
' if you need browser history just comment the lines above and uncomment the lines below
' it keeps the navigation history in the browser
ws.Eval("window.location = arguments[0]", Array As Object(TargetUrl))
ws.Flush
'ws.Close <----- DELETE
End If
'----------------------MODIFICATION-------------------------------
End Sub