ShouldBeBlocked() public static method

public static ShouldBeBlocked ( string url ) : bool
url string
return bool
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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));
 }