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
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