I'm making a BHO that exposes method to JavaScript.
It works okey in IE 9 and IE 10, but fails in IE 8 with RuntimeBinderException: "mshtml.HTMLWindow2Class" does not contain "signJson"
.
Code is mostly based on live reload IE extention.
Here is a way that function is injected into window:
public void InjectScriptResource(dynamic window)
{
var windowEx = (IExpando)window;
if (windowEx.GetProperty("signJson", BindingFlags.Default) == null)
{
windowEx.AddProperty("signJson");
window.signJson = this;
}
}
What's different about about mshtml.HTMLWindow2Class
in IE 8 from IE 9? What is a proper way to inject method into it?