如何在c#webview上加载的HTML页面上查找文本,突出显示文本并将webview滚动到文本位置?
我已经尝试过此代码,但返回“ System.Exception:'Exceçãode HRESULT:0x80020101'”
private async void WebView1_NavigationCompleted(object sender,
WebViewControlNavigationCompletedEventArgs e)
{
string searchFunc;
searchFunc = @"function search(text) {
var element = $(""*: contains(text):first"");
window.scrollTop(element.offset().top);
}";
await webView1.InvokeScriptAsync("eval", new string[] { searchFunc + " search('RELACIONAMENTO');" });
}