如何获取包含“活动内容”的网页出现在WebView中 [英] How to get a web page with "active content" to appear in a WebView

查看:59
本文介绍了如何获取包含“活动内容”的网页出现在WebView中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图回答这个问题已有一段时间了。我尝试过基于Google搜索的各种方法,以及检查StackOverflow和这些论坛。没有运气。

I've been trying to get an answer to this issue for some time now. I've tried various approaches  based on Google searches as well as checking StackOverflow and these forums. No luck.

这就是我想要做的。我想创建一个"地铁"。承载WebView的应用程序。加载到WebView中的HTML将在本地缓存,并包含所谓的"活动内容";即Javascript。具体来说,javascript文件将是
由我创建或由我从本地存储的文件引用。更具体地说,我想使用OpenLayers Web映射API在WebView中显示地图,该地图位于"Metro"中。应用程序。 "地铁"应用程序将做更多的事情,而不仅仅是显示地图,但我是
没有其他事情的问题(但......)。

Here's what I want to do. I want to create a "Metro" application which hosts a WebView. The HTML loaded into the WebView will be cached locally and will contain so-called "active content"; i.e. Javascript. Specifically, the javascript files will be either created by me or referenced by me from files stored locally. More specifcally, I want to use the OpenLayers web mapping APIs to display maps in the WebView, which is in the "Metro" app. The "Metro" app will do more things than just display the map, but I'm not having problems with those other things (yet...).

试图诊断问题更彻底,我暂时切换到WinForms。在这种情况下,将显示错误对话框,并指示与URL关联的语法错误:OpenLayers.js。

In an attempt to diagnose the problem more completely, I switched temporarily to WinForms. In this case, an error dialog is displayed, and indicates a Syntax Error associated with the URL about:OpenLayers.js.

请注意,可以从IE和Chrome成功显示网页在Win8上运行(和Win7一样 - 这不是Win8特定的问题)。

Note that the webpage can be successfully displayed from IE as well as Chrome running on Win8 (and Win7 for that matter -- it is not a Win8 specific problem).

我已经尝试更改IE安全设置并且没有任何运气。具体来说,我已经激活了"活动内容"。设置(至少是我所知道的)。

I've tried changing the IE security settings and have not had any luck. Specifically, I have activated the "active content" settings (at least the ones I am aware of).

我已经嵌入了"网络标记"。在托管"活动内容"的网页中。没有骰子。

I have embedded a "Mark of the Web" in the web page which hosts the "active content". No dice.

我已经尝试过在这个论坛的其他帖子中提到的iframe技巧,再次没有运气。 iframe技术会发生的是,引用的HTML文件的名称显示在实际的iframe中。

I have tried the iframe trick that has been mentioned in other postings in this forum, and again no luck. What happens with the iframe technique is that the name of the referenced HTML file is displayed in the actual iframe.

在所有情况下,HTML页面都可以加载并显示在完整的网页中浏览器(IE,FireFox(Win7)和Chrome),因此它不是HTML或javascript问题。

In all cases, the HTML page can be loaded and displayed in full-fleged web browsers (IE, FireFox (Win7) and Chrome), so it isn't an HTML or javascript problem.

我必须设置什么设置,或者我必须采用什么技术让这个工作?

What setting do I have to set, or what technique do I have to employ to get this to work?

这很重要,而不仅仅是针对这个特定的应用程序。这个世界比MS可以覆盖的范围要广泛得多,并且一个框架不允许开发人员为我的用户提供最大化的功能,这个框架要么不会被使用,要么被b $ b推入更窄更窄的范围内利基。

This is important, and not just for this specific application. The world is much wider than even MS can cover, and a framework that does not allow me the developer to maximize functionality for my users is a framework that either won't be used or will be pushed into a narrower and narrower niche.

如果对此非常生气,我很抱歉,但我对这个问题越来越感到沮丧。请告诉我我必须做些什么才能满足我的要求。

I'm sorry if this comes across as very angry, but I am getting more and more frustrated with this problem. Please tell me what I have to do to be able to satisfy my requirements.

推荐答案

远射但这​​可能与此相关问题?
WebView Control问题在兼容模式下使用VML

简而言之,WebView控件不支持VML,而用于跨浏览器支持的excanvas之类的东西使用VML。我们正在处理一个我们无法控制的第三方网站。

In short, VML is not supported in WebView control, and things like excanvas that is used for cross-browser support uses VML. We were dealing with a third-party site which we had no control over.

OpenLayers可能正在使用VML for IE7 compat,即使IE8 +支持Canvas +

OpenLayers might be using VML for IE7 compat even though Canvas is supported in IE8+

如果有办法可以强制OpenLayers使用SVG,我想它应该没问题......

If there is a way that you can force OpenLayers to use SVG I guess it should be fine...


这篇关于如何获取包含“活动内容”的网页出现在WebView中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆