【发布时间】:2012-08-31 13:25:53
【问题描述】:
我已经开发了一个移动应用程序(在 asp.net 中),我正在使用带有 WebBrowser 控件的 WinForms 应用程序来演示它。
我的主页我正在使用脚本来隐藏地址栏:
<script type="text/javascript">
window.addEventListener("load", function () {
// Set a timeout...
setTimeout(function () {
// Hide the address bar!
window.scrollTo(0, 1);
}, 0);
});
</script>
这在几台机器上运行良好,但今天早上在一台新机器上我在页面加载时遇到了一个弹出窗口:
有问题的机器安装了 IE9,我检查了Disable Script Debugging 设置。
解决此问题的最佳方法是什么。可以在 JS 中添加一些条件在 IE 中运行时不执行吗?
【问题讨论】:
-
WebBrowser 控件似乎没有使用 IE9 工具>选项设置。因此即使
Disable Script Debugging在 IE 中被选中,此设置也不会传播到控件。我设法通过使用WebBrowser.ScriptErrorsSuppressed = True在控件中将其关闭
标签: javascript asp.net winforms internet-explorer-9