Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB6: AddWebResourceRequestedFilter and ico, svg not blocked
#1
Hi. 

I started using the AddWebResourceRequestedFilter method on v1.1.270 build OCX.
It seems to be super for my needs. However, I noticed that when it blocks rcImage and rcMedia
it still downloads graphics in ICO and SVG format.

I use code like this:

antView.AddWebResourceRequestedFilter "*", rcImage
antView .AddWebResourceRequestedFilter "*", rcMedia


Private Sub antView_OnWebResourceRequested(ByVal Args As AntViewAx.IAntViewWebResourceRequestedEventArgs)

  Dim NewResponse As AntViewWebResourceResponse
  If Args.ResourceContext = rcImage Then
    Set NewResponse = wbEdge.CreateWebResourceResponse("", 403, "Blocked", "")
    Args.Response = NewResponse
    Exit Sub
  End If

  If Args.ResourceContext = rcMedia Then
    Set NewResponse = wbEdge.CreateWebResourceResponse("", 403, "Blocked", "")
    Args.Response = NewResponse
  End If

End Sub

Results preview code

Private Sub AntView_OnWebResourceResponseReceived(ByVal Request As AntViewAx.IAntViewWebResourceRequest, ByVal Response As AntViewAx.IAntViewWebResourceResponseView)

 If Response.StatusCode <> 403 Then
    Debug.Print Response.StatusCode & " - " & Request.URI
     'Status: 200 - https://www.interia.pl/favicon.svg
     'Status: 200 - https://www.interia.pl/favicon.ico
End If

End Sub

Am I doing something wrong or maybe favicon can't be blocked through rcImage/rcMedia?

Best regards
Przemek
Reply


Messages In This Thread
VB6: AddWebResourceRequestedFilter and ico, svg not blocked - by MrPrzemek - 2023-08-08, 08:49:42

Forum Jump:


Users browsing this thread: 2 Guest(s)