I'm new here hoping for some help with geckoFX in C#
So I just downloaded the geckoFX and did the following.
Downloaded: geckofx.dll
downloaded: XULRunner
I added the geckofx browser successfully and works fine but when I try to run this code to add JavaScript to the page I get an error.
The error I'm getting is: skybound.geckoFX.AutoJSContext does not contain a definition for evaluate script and jscontext.
Also I don't know if this helps but AutoJSContext and EvaluateScript are not hightlighting.
Here is my code
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Skybound.Gecko;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Skybound.Gecko.Xpcom.Initialize(@"C:\Program Files\xulrunner");
}
private void geckoWebBrowser1_DocumentCompleted(object sender, EventArgs e)
{
string outString = "";
using (AutoJSContext java = new AutoJSContext(geckoWebBrowser1.Window.JSContext))
{
java.EvaluateScript(@"window.alert('alert')", out outString);
}
}
}
You should call EvaluateScript like so:
java.EvaluateScript(@"window.alert('alert')", (nsISupports)geckoWebBrowser1.Window.DomWindow, out result);