public bool OnResourceResponse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response) { if (request.Url.Contains(".ts")) { var content_length = int.Parse(response.ResponseHeaders["Content-Length"]); var filter = FilterManager.GetFileter(request.Identifier.ToString()) as TestFilter; filter.SetContentLength(content_length); } return(false); }
public void OnResourceLoadComplete(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength) { foreach (var single in downloadLst) { if (request.Url.Contains(single)) { var filter = FilterManager.GetFileter(request.Identifier.ToString()) as TestFilter; NotifyMsg?.Invoke(single, filter.dataAll.ToArray()); FilterManager.RemoveFileter(request.Identifier.ToString()); break; } } }
public IResponseFilter GetResourceResponseFilter(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response) { var url = new Uri(request.Url); foreach (var single in downloadLst) { if (url.AbsoluteUri.Contains(single)) { var filter = FilterManager.CreateFilter(request.Identifier.ToString()); return(filter); } } return(null); }