有没有办法从 WebBrowser 控件跟踪 Internet Explorer 错误消息?
有没有办法跟踪 webBrowser 控件中的错误消息?例如,在 Firefox 或 Internet Explorer 中,我可以查看控制台输出中的 Javascript 错误。有没有办法从应用程序内跟踪这些错误?
Is there a way to track error messages in a webBrowser control? For example, in Firefox or Internet Explorer, I can look at the console output for Javascript errors. Is there a way to track those errors from within the application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有两篇相关的 Microsoft 知识库文章:
虽然这些与非托管 C++ 代码相关,但您也应该能够将它们用于 C# Web 浏览器控件。
另一篇文章建议订阅
onerror
事件:最后,还有 与 Delphi 相关的类似 SO 帖子。
There are two related Microsoft KB articles:
Although these are related to unmanaged C++ code, you should be able to adopt these for the C# web browser control, too.
Another article suggests to subscribe to the
onerror
event:And finally, there is a similar SO posting related to Delphi.
使用 window.onerror 事件,例如
use window.onerror event, something like
IE 的更高版本有一个开发人员工具栏,但遗憾的是它不如 Firebug 或 Web Inspector,但值得庆幸的是,我们有 Firebug lite (http://getfirebug.com/firebuglite),它可以帮助解决大多数问题。
Later versions of IE have a developer toolbar but sadly its not quite as good as Firebug or Web Inspector but thankfully we do have Firebug lite (http://getfirebug.com/firebuglite) which can help out with most things.