using GeckoFX web browser, is it possible to pass a GeckoElement through JavaScript like this,
WebBrowser.Navigate("javascript:void("+ele.DomObject+".onclick())");
I’m selecting the DOM element through JavaScript (this works fine) atm, but i have the element in c#.
Unfortunately elements can’t be passed to javascript like that.
However, the WebBrowser.Navigate call is unnecessary and causes an unneeded loss of page variables.
For the sake of completeness I’ve posted a snippet – long winded for this occasion 😉 – that injects javascript and then calls it from an automated button click via a button.click() handler without the need to navigate the browser to run it all.
I’m not sure this snippet will help you, directly, as it’s mainly focused on using the GFXe build of the control but, I’m sure it will point you in a better direction than the
WebBrowser.Navigate(“javascript:hack.goesHere()”); trick.