我用C ++构建了一个dll。在其中,我包含cwebpage.dll,它使用Microsoft Internet Explorer 7.0版作为标准,并带有以下用户代理:
Mozila/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Tridnet/7.0;
.NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR
3.5.30729)
我显示的网页中的以下行弹出脚本错误。
<iframe id="stream" src="https://player.twitch.tv/?channel=example"></iframe>
该错误以弹出警报形式显示,就像下面的屏幕截图所示。
<<window.onerror = null;
或
window.onerror=function(){return true;}
不起作用,脚本错误仍然出现。
我发现了如何从Internet Explorer设置中禁用它,这不是我想要的。它必须是我所有dll用户的通用解决方案。我也曾尝试编辑IE调试,将注册表值禁用为“是”,>]
HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main
Values: Disable Script Debugger/DisableScriptDebuggerIE
但是我没有看到任何效果。脚本错误仍然出现。如何一方面防止出现此错误,另一方面又使脚本继续进行?预先感谢。
我用C ++构建了一个dll。在其中,我包含cwebpage.dll,它使用Microsoft Internet Explorer 7.0版作为标准文件,并带有以下用户代理:Mozila / 4.0(兼容; MSIE 7.0; Windows ...
<script type="text/javascript">
window.onerror = function (e) { return true; }
</script>