geckofx

Scroll Down [GeckoFx + Javascript]

你。 提交于 2019-12-24 00:34:46
问题 I'm trying to scroll down a page with GeckoFx v33 and Javascript. My C# code is the following: private void scrollWb() { string command = "window.scrollTo(0, document.body.scrollHeight);"; using (Gecko.AutoJSContext context = new AutoJSContext(wb.Window.JSContext)) { var result = context.EvaluateScript(command, wb.Window.DomWindow); } My code doesn't work... Can anyone help me please? Thanks. 回答1: Scrolling is handled using the methods of the Window object: Alternatively, you can use a

How to print GeckoWebBrowser to default printer?

ぃ、小莉子 提交于 2019-12-23 18:14:40
问题 I'm trying to print the document in a GeckoWebBrowser, but documentation is limited and to me, it's not at all clear. I found some code on the internet that at least communicates with the printer (it starts beeping) but I think the printer is asking for a Letter size paper, but it requires the settings to be from print.GetGlobalPrintSettingsAttribute() , if I try my own settings, it gives me a NotImplementedException . I suspect this is exception is raised on my Gecko.PrinterSettings, because

GeckoFX Observer Service

99封情书 提交于 2019-12-23 04:47:55
问题 I'm trying to block specific images on a page from loading, but I've ran into a bit of trouble. GeckoWebBrowser's HttpActivityObserver is returning a Not Implemented exception and crashing my program, so I'm trying to implement my own observer but the observe method isn't being called. Any ideas would be helpful. public class HttpObserver : nsIObserver { private nsIObserverService service; private List<string> bans; public HttpObserver() { bans = new List<string>(); service = Xpcom

How do I handle file downloads in GeckoFX?

假装没事ソ 提交于 2019-12-22 20:03:09
问题 I am using the latest GeckoFX 18 (hindlemail's fork) and have tried hard to achieve this simple method : Handle file downloads. I want to know if there is a file download happening in the GeckoWebBrowser. There is no file download event, and even worse : clicking a link that leads to a file download doesn't trigger /any/ event. It just doesn't do nothing. No download dialog, no save file dialog, no url, no nothing. Is there a way I can handle file downloads ? 回答1: By using hindlemail's fork

How do I handle file downloads in GeckoFX?

喜你入骨 提交于 2019-12-22 20:00:10
问题 I am using the latest GeckoFX 18 (hindlemail's fork) and have tried hard to achieve this simple method : Handle file downloads. I want to know if there is a file download happening in the GeckoWebBrowser. There is no file download event, and even worse : clicking a link that leads to a file download doesn't trigger /any/ event. It just doesn't do nothing. No download dialog, no save file dialog, no url, no nothing. Is there a way I can handle file downloads ? 回答1: By using hindlemail's fork

Using GeckoWebBrowser (v45.0.34.0) in a VB.NET project

≡放荡痞女 提交于 2019-12-22 11:27:54
问题 I am trying to make GeckoWebBrowser (version 45.0.34.0) control to work into my VB.NET project with no luck!!! Here is the steps I follow... 1. I do right click on my project into Solution Explorer list and then Manage NuGet Packages . 2. I find and install Geckofx45. 3. Then I go into my Project's properties , into Compile tab and I change Target CPU to x86 . 4. I Rebuild my project. 5. Then I add GeckoWebBrowser control into my Toolbox by selecting the Geckofx-Winforms.dll file from ...

How to set different proxies for each GeckoFX instance?

梦想与她 提交于 2019-12-20 03:29:37
问题 To set a proxy we need to change the GeckoPreferences.User[""] and this is the same for all instances, for exemple: GeckoPreferences.User["network.proxy.http"] = "x.com"; Is it possible to set a different proxy for each geckoFX instance? If this is not possible, are there any kinds of workarounds? 回答1: All GeckoFX browser controls running in the same application shares preferences (and cache, cookies etc). To run two GeckoFX web browser controls with separate preferences, the only options is

how to handle downloads on gecko15 with mozilla xul15 in visual basic?

泪湿孤枕 提交于 2019-12-13 04:45:41
问题 I am using gecko15 with mozilla xul15 as a web browser on my visual basic application anyone knows how i can handle downloads please ? because, when i click on a file to download from that browser nothing happens. thanks a lot for any help. 回答1: Also: @Form LOad Event: Add: AddHandler Gecko.LauncherDialog.Download, AddressOf LauncherDialog_Download Then Private Sub LauncherDialog_Download(ByVal sender As Object, ByVal e As Gecko.LauncherDialogEvent) e.cancel() try catch ex as exception

How to override headers in geckoFX?

烈酒焚心 提交于 2019-12-12 03:11:05
问题 I am trying to use this method: GeckoMIMEInputStream postdata = new GeckoMIMEInputStream(); postdata.AddHeader("Accept-Language", "ru,en-us;q=0.7,en;q=0.3"); browser.Navigate(someurl, flags, referer, postData); but it adds "ru,en-us;q=0.7,en;q=0.3" to already existing "Accept-Language" string! How to override? 回答1: i found it, to change accept_languages: GeckoPreferences.User["intl.accept_languages"] = "ru"; 来源: https://stackoverflow.com/questions/9739406/how-to-override-headers-in-geckofx

How to load another JQuery version from GeckoWebBrowser control

做~自己de王妃 提交于 2019-12-12 02:47:14
问题 I use Gecko Browser in C#. The following code shows that jQuery is loaded. GeckoWebBrowser GWB = new GeckoWebBrowser ..... bool JSExec; string JSresult = ""; string JStext = @"alert(jQuery.fn.jquery);"; using (AutoJSContext JScontext = new AutoJSContext(GWB.Window.JSContext)) { JSExec = JScontext.EvaluateScript(JStext, (nsISupports)GWB.Window.DomWindow, out JSresult); } Alert box display 1.4.4 Is it possible to load a newer version of jQuery? Eg 2.0.2 => https://ajax.googleapis.com/ajax/libs