vb.net 使用 Webbrowser 控件和 https 时出现 Javascript 错误,但它在 IE 中有效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18668557/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 14:58:29  来源:igfitidea点击:

Javascript error when using Webbrowser control and https , yet it works in IE

javascriptvb.netbrowserwebbrowser-control

提问by Wild138

I have a Webbrowser control on a form (in VB.net) and am navigating to a site

我在表单上有一个 Webbrowser 控件(在 VB.net 中)并且正在导航到一个站点

WebBrowser1.Navigate("https://www.offerpop.com")

and it gives me a javascript error, yet if I go to it directly in a browser (IE 10 or otherwise) it loads fine.

它给了我一个 javascript 错误,但如果我直接在浏览器(IE 10 或其他)中访问它,它加载得很好。

It only happens with https

它只发生在 https

WebBrowser1.Navigate("http://www.offerpop.com")

works fine.

工作正常。

I think it's something to do with the way the relative path and proxy independent way the source is specified

我认为这与指定源的相对路径和代理独立方式有关

<script type="text/javascript" src="js/lead_tracking.js"></script>

but don't know how to get around it.

但不知道如何解决它。

Any ideas.

有任何想法吗。

采纳答案by user1600124

If not specified, webbrowser control would run in IE7 compatible mode on IE 9 core.. i think. Not sure which version it would be if you have IE 10. You can use Meta tag on the page to control it. Check the following thread, it's c# but basically the same thing. Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?

如果未指定,webbrowser 控件将在 IE 9 核心上以 IE7 兼容模式运行..我认为。不确定如果你有 IE 10 会是哪个版本。你可以使用页面上的 Meta 标签来控制它。检查以下线程,它是 c# 但基本相同。 IE9 WebBrowser Control 是否支持 IE9 的所有功能,包括 SVG?