public CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) { if (RequestsFiltering.ShouldBeBlocked(request.Url)) { if (!callback.IsDisposed) { callback.Dispose(); } return(CefReturnValue.Cancel); } if (UserAgent != null) { var headers = request.Headers; headers[@"User-Agent"] = UserAgent; request.Headers = headers; } return(CefReturnValue.Continue); }
public bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect) { // if (request.TransitionType.HasFlag(TransitionType.ForwardBack)) return true; return(RequestsFiltering.ShouldBeBlocked(request.Url)); }