Question Firefox Web Browser ?

janaka

Member
Joined
Apr 15, 2011
Messages
7
Programming Experience
1-3
Can you please tell me How can i set Firefox web Browser in VB.NET application.

This is the simple code

WebBrowser1.Navigate("www.google.com")

This code is ok. It will open Google site with in the Browser. But I need to Open it with Mozilla Firefox. Can you Please tell me How can i do it ?
 
to open in default browser:
VB.NET:
Process.Start("www.google.com")
if Firefox is installed but not default:
VB.NET:
Process.Start("firefox", "www.google.com")
 
Please Help me

Thanks lot Join. This will Open with Firefox. But I need to Open Firefox within my WebBrowser1. Please tell me how can i Do it.

Please tell me How can i set WebBrowser1 as Firefox?

Thanks
 
Thanks lot JohnH

I have done following things.
First install MozillaControl1712
Then add MozillaBrowser Class under COM Components
Then my code change as AxMozillaBrowser1.Navigate("www.google.com")
But following error Display

error.png

Thanks lot 4 your Great Help. Please answer for this
 
Download, unzip, add to toolbox > form. Get XULRunner and add the initialize command explained in readme.txt.
 
Thanks JohnH,
Can u pls explain " add to toolbox > form. Get XULRunner and add the initialize command explained in readme.txt. "

I have dowaloaded Skybound.GeckoFX.src.v1.9.1.0 and tried but fail. Pls tell me again step by step your procedure.

Thanks lOT
 
Unzip it. Use context menu in Toolbox and 'choose items', browse to the Gecko dll file. Now there is a Gecko item in toolbox, as usual drag it to a form to add it to form.
Read the readme.txt, it says you need XULrunner, search for it, download it, and unzip it. It also says you need to add the initialize command in application startup. How to: Handle Application Events (Visual Basic)
 
Pls help me again. These are the steps I have done. Pls tell me what's wrong

1. I have added GeckoWebBrowser1 using Toolbox > Choose Item > .Net Framework >Click GeckoWebBrowser

2. Then Downloaded xulrunner-1.9.en-US.win32 and unzip

3. Then In Project Solution Explorer > Right Click My application > Properties > Click View Application Events

4. Then in VB.NET Coding Under General I have selected MyApplication Events. Under Declaration I have selected Startup

Pls tell me Next Steps

I have added code as follows mentioned in the Readme

Namespace My

' The following events are available for MyApplication:
'
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
'Skybound.Gecko.Xpcom.Initialize
Skybound.Gecko.Xpcom.Initialize("C:\Users\janaka\Downloads\xulrunner-1.9.en-US.win32\xulrunner")
End Sub
End Class

End Namespace

What are the wrong things I have done. Pls tell me How can I set code as follows

Form1.GeckoWebBrowser1.Navigate("www.google.com")

Pls JohnH help me
 
That appear to be correct. Why do you think you did something wrong?
 
Application is Not running.. When I run the Application error msg appear as follows


Untitled.png

Is it correct this coding under Startup

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
'Skybound.Gecko.Xpcom.Initialize

Skybound.Gecko.Xpcom.Initialize("C:\Users\janaka\Downloads\xulrunner-1.9.en-US.win32\xulrunner")

Form1.GeckoWebBrowser1.Navigate("www.google.com")

End Sub

Pls reply me
 
The Navigate call you should rather be doing in forms Load event handler. Doing that from the application event will only get you InvalidOperationException "Cannot call Navigate() before the window handle is created."
Not sure if minor/revision version matters, but the Xul I downloaded was 1.9.2.16.
Also, 32bit compile is required if you're on 64bit system.
 
Back
Top