Update RequestHandler.OnResourceRedirect example - redirect google to github

This commit is contained in:
amaitland
2016-10-31 19:04:50 +10:00
parent 77413cf2a7
commit cecc8b14f7
+2 -2
View File
@@ -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";
//}
}