[英]cefsharp location change event C#
我需要知道如何在cefsharp上更改Web视图的位置时设置事件以及如何防止不重定向到其他URL
BrowserSettings browserSettings = new BrowserSettings();
browserSettings.FileAccessFromFileUrlsAllowed = true;
browserSettings.UniversalAccessFromFileUrlsAllowed = true;
browserSettings.TextAreaResizeDisabled = true;
WebView web_view;
web_view = new WebView("http://google.com", browserSettings);
web_view.LocationChanged += ??`enter code here`
web_view.Dock = DockStyle.Fill;
this.Controls.Add(web_view);
我认为您需要提供IRequestHandler
接口的实现。 请参阅https://github.com/cefsharp/CefSharp/blob/CefSharp1/CefSharp.Example/ExamplePresenter.cs#L263如果您返回true
您将阻止导航。
您正在谈论的LocationChanged
事件与CefSharp Web导航无关。 如果你谷歌“LocationChanged事件”,它可能会留下你的笑容:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.