Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CefSharp.Core/Internals/ClientAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ namespace CefSharp

CefRequestWrapper^ wrapper = gcnew CefRequestWrapper(request);

return handler->OnBeforeBrowse(_browserControl, wrapper, isRedirect);
return handler->OnBeforeBrowse(_browserControl, wrapper, isRedirect, frame->IsMain());
}

bool ClientAdapter::OnCertificateError(cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr<CefAllowCertificateErrorCallback> callback)
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Example/RequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class RequestHandler : IRequestHandler
public static readonly string VersionNumberString = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}",
Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion);

bool IRequestHandler.OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect)
bool IRequestHandler.OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect, bool isMainFrame)
{
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion CefSharp/IRequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public interface IRequestHandler
/// <param name="browser">the browser object</param>
/// <param name="request">the request object - cannot be modified in this callback</param>
/// <param name="isRedirect">has the request been redirected</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add additional please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

/// <param name="isMainFrame">whether the request comes from main frame or not</param>
/// <returns>Return true to cancel the navigation or false to allow the navigation to proceed.</returns>
bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect);
bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect, bool isMainFrame);

/// <summary>
/// Called when a certificate error is thrown.
Expand Down