html이 ms-appdata에서로드 된 경우 Windows에서 WebView_ScriptNotify 이벤트가 호출을 수신하지 못하게합니다.UWP의 appdata에서 html로 scriptNotify를받는 방법 C#
ms-appx-web 프로토콜을 사용하여 내 앱 번들에서 이러한 파일을로드 할 수 있다는 것을 알고 있지만 표시 할 데이터가 앱 설치 후 다운로드되므로 옵션이 없습니다. html 파일에 참조 된 라이브러리가 포함되지 않기 때문에 webView.navigateToString을 사용할 수도 없습니다.
가 현재 내 Class.xaml.cs HTML 파일WebView webView = new WebView();
webView.ScriptNotify += WebView_ScriptNotify;
Uri navigationUri = new Uri(@"ms-appdata:///local/index.html");
webView.Navigate(navigationUri);
및
private void WebView_ScriptNotify(object sender, NotifyEventArgs e)
{
System.Diagnostics.Debug.WriteLine("ScriptNotifyValue: " + e.Value);
//I want to do the magic here, but this will never be called
}
을이 같은 노력하고있어 또한
<div id="content">
<div class="btn" onClick="window.external.notify('hello world');"</div>
</div>
입니다, 그건 아무 옵션을 사용하면 InvokeScript()를 사용할 수 있습니다. 왜냐하면 이벤트가 발생해야하는시기와 값을 알 수 없기 때문입니다.
ms-appdata의 파일을 사용해야합니다.
해결 방법을 알고 계십니까? 대체 workaroung도 나를 놀라게합니다.
멋진 작품입니다. + –