GeckoFX

Skybound

Skybound Software is looking to hire experienced C# developers to work on Stylizer and other forthcoming Skybound products. Click here for details.

GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control. Download GeckoFX @ Google Code >

GeckoFX is made by Skybound Software, authors of Stylizer—the professional CSS editor with a strong focus on visual control, error-free workflow, and productivity. Learn About Stylizer >

GeckoFX Forum

Discuss GeckoFX, the Open-Source Gecko Control for .NET

You are not logged in.

Default website for Gecko object?

#1 January 25, 2010 1:18 PM

madlan
Member
Registered: January 25, 2010
Posts: 12

Default website for Gecko object?

Hi, does Gecko have a default website option? I cannot see one in the available options.
I tried WebBrowser.Navigate(url) after Xpcom.Initialize but this complains that it cannot navigate before initializing.

Thanks.

Offline

 

#2 January 26, 2010 11:50 PM

Cristian
Member
Registered: January 16, 2010
Posts: 17

Re: Default website for Gecko object?

This code works for me:

Code:

        public Form1()
        {
            string strCurrentDir = Directory.GetCurrentDirectory();

            Skybound.Gecko.Xpcom.Initialize(strCurrentDir);

            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            geckoWebBrowser1.Navigate("google.es");
        }

I just created a form in C# and added the control to the page.
If you want to navigate without a form it is gone to be more difficult than that.
You can find some clues here: http://www.povo.com/Development/GeckoFX … ipt_Engine

Offline

 

#3 February 01, 2010 7:46 PM

madlan
Member
Registered: January 25, 2010
Posts: 12

Re: Default website for Gecko object?

Hi Cristian, thats what I'm using at the moment - I want Gecko to load a default page rather than about:blank when initialized - I'm writing a dll that does'nt use forms so cannot use form load event.

Is there any settings in the xml\config files to default a 'home' page? Can I pass a url during initialization?

Thanks!

Offline

 

Board footer