admin管理员组文章数量:1293532
Google searches are leading me down a bunch of dead ends with this one.
I am developing an Excel add-in in VBA, and part of it involves the use of the WebBrowser control to display a (known) webpage inside a form and access its DOM ponents.
Unfortunately, this leaves me at the whim of the user's version of Internet Explorer.
For our actual webpages, we can use Chrome Frame support to allow IE users to see the page in the way we intend without worrying about their browser version, but the WebBrowser control does not see the browser plugins.
I have taken a look at WebKit.NET and GeckoFX. They sort of work, but unless I am pletely missing something, they don't seem to have Javascript or CSS engines in them at all. Or (in the case of GeckoFX), they are using old engines. That makes them useless.
Is there any ActiveX control that I can embed in a VBA form which works like the WebBrowser control (with a similar-if-not-identical API), uses a different rendering engine that keeps up with the latest version of Mozilla/Chrome/Opera, and still supports Javascript and CSS correctly?
Thank you!
(Some edits based on the ments)
EDITED AGAIN: I found out from one answer below that I was looking at an outdated version of GeckoFX, but the newest version looks promising. But now I have a new related question: How do I include GeckoFX in VBA? Windows does not allow me to register it as a COM object. Do I have to build it myself from source somehow? Or what?
Google searches are leading me down a bunch of dead ends with this one.
I am developing an Excel add-in in VBA, and part of it involves the use of the WebBrowser control to display a (known) webpage inside a form and access its DOM ponents.
Unfortunately, this leaves me at the whim of the user's version of Internet Explorer.
For our actual webpages, we can use Chrome Frame support to allow IE users to see the page in the way we intend without worrying about their browser version, but the WebBrowser control does not see the browser plugins.
I have taken a look at WebKit.NET and GeckoFX. They sort of work, but unless I am pletely missing something, they don't seem to have Javascript or CSS engines in them at all. Or (in the case of GeckoFX), they are using old engines. That makes them useless.
Is there any ActiveX control that I can embed in a VBA form which works like the WebBrowser control (with a similar-if-not-identical API), uses a different rendering engine that keeps up with the latest version of Mozilla/Chrome/Opera, and still supports Javascript and CSS correctly?
Thank you!
(Some edits based on the ments)
EDITED AGAIN: I found out from one answer below that I was looking at an outdated version of GeckoFX, but the newest version looks promising. But now I have a new related question: How do I include GeckoFX in VBA? Windows does not allow me to register it as a COM object. Do I have to build it myself from source somehow? Or what?
Share edited Nov 8, 2011 at 16:42 Josh asked Nov 3, 2011 at 14:19 JoshJosh 4,6428 gold badges39 silver badges42 bronze badges 5- GeckoFX seems to support both CSS and JavaScript. Why do you think it doesn't? – arx Commented Nov 3, 2011 at 23:04
- When I tried pointing it at my test page (which used javascript and jqueryUI), I saw an unadorned ugly CSS-less page. Like I said, maybe I did something wrong. – Josh Commented Nov 4, 2011 at 2:45
- Oh right, the other thing, the GeckoFX documentation says it works best with Firefox 3.5 engine; I really need something that works with the latest-and-greatest (Firefox 7-ish, or Chrome, or even Opera) – Josh Commented Nov 4, 2011 at 12:07
- Is it such a problem to rely on IE? IE has a lot of patibility settings to ensure a mon behavior across versions (from 7 to 9 mostly as 6 is almost dead). Cf msdn.microsoft./en-us/ie/cc405106 – Simon Mourier Commented Nov 13, 2011 at 11:32
- Most of the target users of this add-in are, unfortunately, on XP with IE6; we can "strongly suggest" that they upgrade to 8 (but not 9, due to OS restrictions), but if I use the standard WebBrowser, I pretty much have to make sure it works with 6. – Josh Commented Nov 13, 2011 at 17:43
3 Answers
Reset to default 5 +25Gecokfx supports Firefox up to 33.0
https://bitbucket/geckofx/geckofx/wiki/Version_lists
It supports both Javascript and CSS.
If you want it to work in elderly VBA you need a browser in an ActiveX wrapper.
The Mozilla ActiveX Control would fit the bill, but that seems to be dead. (It lived on in Mozilla Prism, now Chromeless, but that doesn't have a binary download. And you can apparently build it yourself from the XULRunner source, but that's probably not straightforward.)
It might not be too hard to build GeckoFX as an ActiveX control.
If you use GeckoFX or Chrome Frame you will be at the mercy of the user's Firefox or Chrome version. No way to solve this problem other than specifying a baseline version for your users.
If you cannot do this I suggest you work around the differences in your VBA code.
In other words: Use the IE WebBrowser control, because it is guaranteed to be installed in some version or another, and either specify a minimum version of IE (I suggest IE6 which everyone should have) and cope with the differences by detecting the version and working around the differences from VBA.
本文标签: javascriptNonIE WebBrowser ActiveX controlStack Overflow
版权声明:本文标题:javascript - Non-IE WebBrowser ActiveX control - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741581088a2386575.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论