From cecc8b14f727ef42fa54178e72e3dc2e13745493 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 31 Oct 2016 19:04:50 +1000 Subject: [PATCH] Update RequestHandler.OnResourceRedirect example - redirect google to github --- CefSharp.Example/RequestHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp.Example/RequestHandler.cs b/CefSharp.Example/RequestHandler.cs index 3ec0e16ba..ba9ec69de 100644 --- a/CefSharp.Example/RequestHandler.cs +++ b/CefSharp.Example/RequestHandler.cs @@ -159,9 +159,9 @@ namespace CefSharp.Example void IRequestHandler.OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, ref string newUrl) { //Example of how to redirect - need to check `newUrl` in the second pass - //if (string.Equals(frame.GetUrl(), "https://www.google.com/", StringComparison.OrdinalIgnoreCase) && !newUrl.Contains("github")) + //if (request.Url.StartsWith("https://www.google.com", StringComparison.OrdinalIgnoreCase) && !newUrl.Contains("github")) //{ - // newUrl = "https://github.com"; + // newUrl = "https://github.com"; //} }