在 windows phone 8.1 的 WebView 中查找文本/字符串

Find a Text / String in a WebView of windows phone 8.1

我在 WebView 中打开了一个本地 html 文件,这里我需要从 webview 中搜索文本。 Android 有 webview.findAll(string); & webview.findAllAsync(string); 方法来实现这一点。

在 windows phone 8.1 中是否有任何方法或替代方法可以做到这一点??

string html = await myWebView.InvokeScriptAsync("eval", new string[] { "document.documentElement.outerHTML;" });
if(html.Contains("Your text")){
    //text available in the web page
}

或者如果您想获取位置,您可以使用 html.indexOf("Text") 方法。