paul moore
Posts: 5
Joined: 2013-01-31
|
I have a plugin that also creates a embedded web control (C# web browser control). I need to be able to hook ito that the same way I am hooked into the main browser window. I need to get at the same HtmlDocument object.
Plugin has mshtml.HTMLDocument HTMLDocument.
I can get Script object for that and do stuff
WebBrowser has System.Windows.Forms.HtmlDocument Document property
I try all sorts of tricks to get the underlying mshtml.HTMLDocument but cannot get it
In particular I want to create object in document DOM that points to my code. Like this
scriptEngine.GetType().InvokeMember("bhoModule", BindingFlags.SetProperty, null, scriptEngine, new object[] { new XX.XX() }); |
|
paul moore
Posts: 5
Joined: 2013-01-31
|
i worked it out
var doc = webBrowser1.Document;
var d = doc.DomDocument as mshtml.HTMLDocument;
But now I have different question
the InvokeMember code above will only set variables that already exist in javascript engine (ie I need var bhoModule; in html page). Is there a way to set a variable in global scope (wind ow .foo) without having to modify script of page |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Paul,
I didn't tested it but you probably can use the 'execScript' function of HTML Window. |
|