GeckoFX JSContext not found C#
GeckoFX JSContext not found C#
我试图使用以下代码将javascript注入我的GeckoFX浏览器。
GeckoWebBrowser browser = ....;
using (AutoJSContext context = new AutoJSContext(browser.JSContext))
{
string result;
context.EvaluateScript("3 + 2;", out result)
}
来自这里找到的另一篇SO帖子:如何通过GeckoFX执行Javascript命令
但是我得到一个错误:
'Gecko.GeckoWebBrowser' 不包含 'JSContext' 的定义,也找不到接受类型为 'Gecko.GeckoWebBrowser' 的第一个参数的扩展方法 'JSContext'(您是否缺少 using 指令或程序集引用?)
对 C# 相当陌生,我不太确定我错过了什么?我花了几个小时搜索和故障排除,但没有找到关于我忽略和/或缺少什么的解决方案。如果有人对此有所了解,将不胜感激。谢谢!!
似乎在版本 22 中,JSContext 已经下移了一个级别,到 Window。
所以现在你会想要
using (AutoJSContext context = new AutoJSContext(browser.Window.JSContext))
我在新的单元测试中发现了这一点。
相关文章:
- Requirejs main.js could not be found
- JavaScript文件在IIS上返回404 Not Found
- react-css-module module not found
- grails3 jquery not found
- GeckoFX JSContext not found C#
- Marionette: childViewContainer was not found
- Js not found spring mvc
- Ajax POST MyUrl 404 (Not Found)
- 节点webkit中的Require('jquery ui')产生navigator not found错
- xmlhttp.send() returns 404 Not Found (Ajax)
- Socket.io.js not found (node.js + express + socket.io)
- Module not found: Error: Cannot resolve module 'fs'
- 状态码:404 Not Found (from cache) |使用AngularJS的混合型应用
- not found error: DOM exception 8
- Systemjs and tsc setup - *.ts.js 404 (Not Found) Error
- Angular2材质设计alpha.9-3有'404 not found'@angular /材料
- Laravel Routes/jQuery $.post() returning 404 Not Found
- http://localhost/undefined 404 (Not Found)
- /bin/sh not found -- spawnSync
- 节点路由器.delete函数返回404 Not Found