public void AddScriptContent(string content)
{
Debug.Assert(!InvokeRequired);
GeckoDocument doc = WebBrowser.Document;
var head = doc.GetElementsByTagName("head").First();
GeckoScriptElement script = doc.CreateElement("script") as GeckoScriptElement;
script.Type = "text/javascript";
script.Text = content;
head.AppendChild(script);
}