views:

5952

answers:

6

Start with the simplest task of capturing the URL in Firefox from a C# application. It appears using user32.dll Windows API functions will not work as is the approach for capturing the URL within IE.

+3  A: 

WebAii can automate FireFox, including setting and retrieving the URL

Mark Cidade
A: 

Should I need to do a capture of the URL with AutoHotkey, for example, I would send Ctrl+L (put focus in address bar and highlight content) and Ctrl+C (copy selection to clipboard). Then you just read the clipboard to get the info.

For more complex tasks, I would use Greasemonkey or iMacros extensions, perhaps triggered by similar keyboard shortcuts.

PhiLho
+1  A: 

One Microsoft tool I ran into:

UI Automation, as part of .NET 3.5 http://msdn.microsoft.com/en-us/library/aa348551.aspx

Here's an example: http://msdn.microsoft.com/en-us/library/ms771286.aspx

I don't have UI Spy on my pc to interrogate Firefox, so I don't know if this will help out with your user32.dll problem.

foson
+1  A: 

It appears to be very beta-ey, but someone built a .net connector for mozrepl. Actually, the mozrepl codebase just moved to github. But mozrepl lets you issue commands to the Firefox's XUL environment.

pc1oad1etter
+3  A: 

WatiN has recently added support for Firefox.

Timothy Lee Russell
+1  A: 

Try Selenium (the Google testing engine - http://seleniumhq.org/) You can record task (Webpages UI related) done in Firefox and the convert the recording into a C# source :)