Search code examples
c#firefox-addon

Get web page contents from Firefox in a C# program


I need to write a simple C# app that should receive entire contents of a web page currently opened in Firefox. Is there any way to do it directly from C#? If not, is it possible to develop some kind of plug-in that would transfer page contents? As I am a total newbie in Firefox plug-ins programming, I'd really appreciate any info on getting me started quickly. Maybe there are some sources I can use as a reference? Doc links? Recommendations?

UPD: I actually need to communicate with a Firefox instance, not get contents of a web page from a given URL


Solution

  • It would help if you elaborate What you are trying to achieve. May be plugins already out there such as firebug can help.

    Anways, if you really want to develop both plugin and C# application:

    Check out this tutorial on firefox extension: http://robertnyman.com/2009/01/24/how-to-develop-a-firefox-extension/

    Otherwise, You can use WebRequest or HttpWebRequest class in .NET request to get the HTML source of any URL.