geckofx

What is the recommended way to call a javascript function from C# using the WinForms GeckoFX control?

岁酱吖の 提交于 2019-12-01 12:12:53
The questions says it all. I have everything wired up and know how to send messages from the browser html to c#, but not the other way. I should be able to do something like: browserControl.JSCall("myFunction('Dave','Smith');"); ...and in the web code: function myFunction(firstName, lastName) { $("#mydiv").text(firstName + ' ' + lastName); } Thanks - Dave John Hatton You can do this using Navigate: browserControl.Navigate("javascript:void(myFunction('Dave','Smith'))"); Note, I find that the code isn't actually run until the application event loop executes. If that's a problem for you, you

What is the recommended way to call a javascript function from C# using the WinForms GeckoFX control?

蓝咒 提交于 2019-12-01 11:58:21
问题 The questions says it all. I have everything wired up and know how to send messages from the browser html to c#, but not the other way. I should be able to do something like: browserControl.JSCall("myFunction('Dave','Smith');"); ...and in the web code: function myFunction(firstName, lastName) { $("#mydiv").text(firstName + ' ' + lastName); } Thanks - Dave 回答1: You can do this using Navigate: browserControl.Navigate("javascript:void(myFunction('Dave','Smith'))"); Note, I find that the code isn

Help With Proxy Username & Pass with GeckoFX?

拟墨画扇 提交于 2019-12-01 08:13:45
I am trying to set the proxy username and password. I saw this posting ( http://geckofx.org/viewtopic.php?id=832 ) and I thought it might be a similar setting for the username/password, such as : Skybound.Gecko.GeckoPreferences.User["network.proxy.user"] = (user); Skybound.Gecko.GeckoPreferences.User["network.proxy.password"] = (password); But, nothing has worked so far. Can anyone help? I would really appreciate it!!! I am using VB.net if that helps. Thanks!! You probably need to set proxy type to 1. To detect proxy settings automatically, try this: Uri website = new Uri("http://stackoverflow

How to set user agent in GeckoFX?

强颜欢笑 提交于 2019-11-30 15:35:37
After using the webbrowser control for some time, I decided to give gecko a try, because of the webbrowser's problems that I've experienced, low speed and degrading performance. I downloaded the latest version of geckofx (16.0.0.2) and xulrunner(16.0.2) and created a geckoWebbrowser control. When I tried to navigate to a webpage I got a javascript.alert that my web browser is not supported and that I should use firefox>2.0.0.2 which of course is ridiculous. The problem was - I assume - that the detected useragent string was "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/ /16.0" instead of

How to set user agent in GeckoFX?

前提是你 提交于 2019-11-29 21:56:28
问题 After using the webbrowser control for some time, I decided to give gecko a try, because of the webbrowser's problems that I've experienced, low speed and degrading performance. I downloaded the latest version of geckofx (16.0.0.2) and xulrunner(16.0.2) and created a geckoWebbrowser control. When I tried to navigate to a webpage I got a javascript.alert that my web browser is not supported and that I should use firefox>2.0.0.2 which of course is ridiculous. The problem was - I assume - that

How to handle downloading in GeckoFX 29

只谈情不闲聊 提交于 2019-11-29 12:17:40
How can I handle downloading in GeckoFx I'm using version 29 I've found some ways like adding event of LauncherDialog_Download(object sender, LauncherDialogEvent e) But, I'm not able to add handler for this event I tried this for handler LauncherDialogFactory.Register(); LauncherDialog.Download += LauncherDialog_Download; But, it is showing as error, how can i add handler and is there any other ways to handle downloading in GeckoFx 29 ? In form load after your browser.navigate("http://www.domain.com"); Use this: LauncherDialog.Download += LauncherDialog_Download; Create LauncherDialog_Download

How to use Gecko in C#

空扰寡人 提交于 2019-11-29 08:32:20
问题 I need a Gecko WebBrowser Control I need a sample code or a link which explains how to use GECKO If anyone has used Gecko, I could do with some advice 回答1: Original tutorial with detailed snapshots can be found here. To embed Gecko browser in your winform application, you need: XulRunner: XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It provides mechanisms for installing, upgrading, and uninstalling

How to make Gecko use seperate CookieContainer per instance?

≡放荡痞女 提交于 2019-11-28 05:29:55
问题 Since GeckoWebBrowser in .Net shares cookies with all other instances of GeckoWebBrowsers I would like for a GeckoWebBrowser to have it's own cookie container which doesn't share any cookies that was created previously in other GeckoWebBrowsers or other instances. So for example when I create a GeckoWebBrowser it shouldn't have any cookies. And when I run 2 instances of GeckoWebBrowser they have their own cookie container and don't share or conflict cookies with each other. How is that

Run multiple UI Threads

隐身守侯 提交于 2019-11-26 22:25:38
Skip to the bottom for the question; this is just some extra info I am using a component (GeckoFX) to render some websites, well fine, yet it can only be used in a Windows Form; as it has to bind to a WinForms object that can be drawn. Because all the WinForms are running in the same thread, I can only use one GeckoFX instance at a time; so I decided to create a 'worker class' in the form of a WinForm, and add all the logic in there. The form doesn't require to communicate with the main form. Now I can fire up 10 windows, and they will eventually work, but every new form will wait before all

Run multiple UI Threads

╄→гoц情女王★ 提交于 2019-11-26 08:21:10
问题 Skip to the bottom for the question; this is just some extra info I am using a component (GeckoFX) to render some websites, well fine, yet it can only be used in a Windows Form; as it has to bind to a WinForms object that can be drawn. Because all the WinForms are running in the same thread, I can only use one GeckoFX instance at a time; so I decided to create a \'worker class\' in the form of a WinForm, and add all the logic in there. The form doesn\'t require to communicate with the main