看楼主你描述的貌似是想往其他页面注入数据,其实不是修改它的JS而是替换成你自己的js
var htmlDoc = (IHTMLDocument3)webBrowser1.Document.DomDocument;
HTMLHeadElement head = htmlDoc.getElementsByTagName("head").Cast
var script = (IHTMLScriptElement)((IHTMLDocument2)htmlDoc).createElement("script");
script.text = "window.onload=function() { ....... }";
head.appendChild((IHTMLDOMNode)script);
代码是刚刚网上当的,看了下差不多就这意思吧