c# - How do I append child node in an Internet Explorer BHO extension? -



c# - How do I append child node in an Internet Explorer BHO extension? -

i porting firefox extension , trying append button node on web page. nil occurs on page. believe has conversion between htmldomnode , htmlelement. don't errors within console using ie dev add together on.

my code:

public void ondocumentcomplete(object pdisp, ref object url) { htmldocument document = (htmldocument)webbrowser.document; var fblike = document.getelementbyid("likepluginpagelet"); var button = document.createelement("input"); button.setattribute("value", "mybutton"); button.setattribute("onclick", "dosomething()"); ((ihtmldomnode)fblike).appendchild((ihtmldomnode)button); }

you need create fblike dynamic.

public void ondocumentcomplete(object pdisp, ref object url) { htmldocument document = (htmldocument)webbrowser.document; var fblike = document.getelementbyid("likepluginpagelet"); var button = document.createelement("input"); button.setattribute("value", "mybutton"); button.setattribute("onclick", "dosomething()"); dynamic fblike = fblike fblike.appendchild((ihtmldomnode)button); }

c# internet-explorer bho browser-extension

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -