【发布时间】:2013-06-22 07:09:22
【问题描述】:
我正在制作一个向 JavaScript 公开方法的 BHO。
它在 IE 9 和 IE 10 中运行良好,但在 IE 8 中失败并出现 RuntimeBinderException:"mshtml.HTMLWindow2Class" does not contain "signJson"。
代码主要基于live reload IE extention。
这是函数注入窗口的一种方式:
public void InjectScriptResource(dynamic window)
{
var windowEx = (IExpando)window;
if (windowEx.GetProperty("signJson", BindingFlags.Default) == null)
{
windowEx.AddProperty("signJson");
window.signJson = this;
}
}
IE 8 中的mshtml.HTMLWindow2Class 与 IE 9 有什么不同?将方法注入其中的正确方法是什么?
【问题讨论】:
标签: c# internet-explorer-8 bho