c# - GeckoFX - implement search function - how to use nsIWebBrowserFind interface -


could perhaps tell me how should use nsiwebbrowserfind interface in geckofx find strings on webpage?

i tried following code, throws me argumentnullexception - parameter cannot null (punk).

i have no idea means, have never used interfaces before.

        geckowebbrowser browser = getcurrentbrowser();          nsiwebbrowserfind finder = browser.getinterface<nsiwebbrowserfind>();          finder.setsearchstringattribute(searchbox1.text);         finder.findnext(); 

i have tried

    nsiwebbrowserfind finder = gecko.xpcom.getinterface<nsiwebbrowserfind>(browser); 

with same results:(

please help:)

thanks!

this works in geckofx 29.0:

var field = typeof(geckowebbrowser).getfield("webbrowser", bindingflags.instance | bindingflags.nonpublic); nsiwebbrowser browser = (nsiwebbrowser)field.getvalue(webbrowser1); var browserfind = xpcom.queryinterface<nsiwebbrowserfind>(browser); browserfind.setsearchstringattribute(search); try { browserfind.setwrapfindattribute(true); browserfind.findnext(); } catch { } 

some websites frames throws exception after last result however, seems bug in geckofx. did workaround falling javascript find (javascript:window.find) when exception thrown.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -