UWP WebView - OnScriptNotify 失败的侦听器事件

UWP WebView - Listener Event for OnScriptNotify failure

我正在尝试在我们的库中添加有用的错误日志记录,以便在 ScriptNotify 由于 URI 未添加到应用程序清单而失败时打印出错误消息。

这是我使用DevTools调试时在WebView中打印的警告信息:

DOM7010: Unable to receive a ScriptNotify event from: 'https://somerequireddomainhere'. The website attempted to send a ScriptNotify event to the app from a WebView URI that is not included in the ApplicationContentUriRules for this app. To permit this event, add the URI to the ApplicationContentUriRules section of the package manifest. (In Visual Studio, add this URI to the Content URIs tab of the Manifest Designer.)

我希望以某种方式在我们的库中以错误消息的形式公开一条类似的消息,这样它就不会无声地失败,并让其他开发人员了解如何解决这个问题。

如果 ScriptNotify 由于这种情况而失败,是否会触发侦听器或方法?

Is there a listener or method that would get triggered in the event that ScriptNotify fails due to this scenario?

目前没有可以检测到此错误的事件。我们在官方文档中已经说明了这一点,请查看this。在我看来,它非常有用。如果你想要这个活动,请用 windows 反馈中心应用感受 post 它。