|
||
|
|
#1 (permalink) |
|
Newbie
|
Hello,
I'm trying to "control" firefox via a C# program. Is it possible? Actually I can just start the Process firefox.exe but then I don't know how to change the Url of this process, how to get the Url, get the html source code of the actually visited page in this firefox process, ... Can you help me? Is it a way to do that? I hope ![]() ps: I'm french so excuse my poor English. ps2: I went for 5days so I'll read your answers in only 5days ![]() |
|
|
|
|
|
#2 (permalink) | |
|
RunUO Forum Moderator
|
Quote:
2. It's very likely that there is a lot better and easier way then this! but... To get the source code you can "create" your own c# web explorer. There should be a c# library that can "open" a url and "download" the source code so it can be displayed on the screen (look at ConnectUO or many other c# applications that integrate a small web browser into them).
__________________
I always try to help
![]() Sometimes, I don't know how.... ![]() My Web Page Forum Rules ------------------------------------------------------------- Extensive OWLTR System | Token System | World Teleporters ------------------------------------------------------------- |
|
|
|
|
|
|
#3 (permalink) |
|
Newbie
|
I knew those solutions, but the problem is that I ave to invoke a javascript in my page, and to find the parameters of this javascript function.
Actually with the webBrowser control available, I can navigate to the page I want, get the parameters of the javascript function by some functions wich analyse the html-code. But then when i change the Url of my webBrowser in : "javascript: the_function_searched("param1", "other_param");" the browser don't execute the javascript function. In firefox, if I look manually in the code for this function, I can change the url in this way to invoke the javascript function. But in IE, or my webBrowser control wich is based on IE, the manually way doesn't work neither... I find a way to solve this problem by the webBrowser wich got à Document instance wich permit to call the InvokeScript([script], [array of params]) but it doesn't work too... Another way I think, is to user the firefox.exe to open new url, but then how can I get the source code of my page, because in this page, I'm identified by a cookie, session variables, and a get variable wich contain a hash code. Thus at each identification on the website by a different navigator, the hash is changed, and I can't get farther. So the only way is to stay in the same navigator, but my webBrowser don't permit me to invoke scripts... so I really have to find a way to totally control the "moves" of firefox or to invoke the javascripts functions in this webBrowser controle. I'm searching for a solution many hours, an I got headaches now ![]() Thanks for your help. |
|
|
|
|
|
#4 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,740
|
Unless firefox's API is open(which i believe it is not) you cant really do this with C#, and if it is even remotely possible, i can guarentee its not a simple solution.
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|